nudge keys

I need help with this script,please! I want to be able to nudge keyframes in the timeslider by a given amount ,the script works fine for general position controllers, but wont work with custom attributes and visibility and such any help would be great.Thanks

try(destroyDialog AnimSnap) catch()
rollout AnimSnap "Animated Snaps v0.2" width:803 height:56
(
-----------------------------GUI---------------------------------------------------
GroupBox grp2 "Nudge selected frames" pos:[2,1] width:446 height:51
button btnGo "Go" pos:[170,22] width:33 height:23
label lbl1 "Nudge selected keyframes by:-" pos:[25,17] width:83 height:28
spinner spn1 "" pos:[111,26] width:56 height:16 range:[-100,100,0]
button btn2 "1 fr<" pos:[207,22] width:33 height:23
button btn7 "5 fr<" pos:[288,22] width:33 height:23
button btn11 "10 fr<" pos:[367,22] width:33 height:23
button btn16 ">1 fr" pos:[243,22] width:33 height:23
button btn17 ">5 fr" pos:[325,22] width:33 height:23
button btn18 ">10 fr" pos:[404,22] width:33 height:23
----------
GroupBox grp13 "Frame Rate" pos:[458,1] width:94 height:51
label lblcrtfps "current fps:" pos:[469,16] width:58 height:13
button btnfps "25 FPS" pos:[468,32] width:52 height:17
--------
GroupBox grpEnd "End frame" pos:[555,1] width:130 height:51
button btn25 "25" pos:[557,15] width:29 height:12
button btn100 "100" pos:[587,14] width:29 height:12
button btn200 "200" pos:[557,33] width:29 height:12
button btn1k "1000" pos:[587,33] width:29 height:12
spinner spnRng "" pos:[619,28] width:64 height:16 type:#integer

on btnGo pressed do
(

bob = spn1.value

moveKeys $.controller bob #selection
--moveKeys $.all controller bob #selection

)
on btn2 pressed do
(

--nudge frames by - 1 frame
moveKeys $.controller -1 #selection

)
on btn7 pressed do
(

--nudge frames by - 5 frame
moveKeys $.controller -5 #selection

)
on btn11 pressed do
(

--nudge frames by - 10 frame
moveKeys $.controller -10 #selection

)
on btn16 pressed do
(

--nudge frames by + 1 frame
moveKeys $.controller 1 #selection

)
on btn17 pressed do
(

--nudge frames by + 5 frame
moveKeys $.controller 5 #selection

)
on btn18 pressed do
(

--nudge frames by + 10 frame
moveKeys $.controller 10 #selection

)
on btnfps pressed do
(
framerate = 25
)
on btn25 pressed do
(
animationrange = (interval 0f 25f)
)
on btn100 pressed do
(
animationrange = (interval 0f 100f)
)
on btn200 pressed do
(
animationrange = (interval 0f 200f)
)
on btn1k pressed do
(
animationrange = (interval 0f 1000f)
)
on spnRng changed value do
(
aniRng = spnRng.value
animationrange.start = 0
animationrange.end = aniRng as time
)
)
createDialog animsnap 803 52