Since a lot of my job consists of just changing a couple numbers I thought it would be nice to be able to just scroll to change the highlighted quantities quickly and not have to take my hand off the mouse to use the keypad.
When I was just getting into AHK I wrote this little script and it actually did work, though I didn't know anything about variables at the time. I wanna take another crack at this but I was wondering about some tips to do it more efficiently, aside from the obvious of course.
If I remember, It wasn't super reliable, there was often lag, and it still wanted to keep using the horizontal scroll function so I would get windows scrolling all over the place.
I would like to get it to just replace the highlighted text directly instead of just typing it out, but I only know how to address a specific edit control, not just whatever one contains the highlighted text.
Any useful ideas would be greatly appreciated.
Code: Select all
#MaxHotkeysPerInterval 1000
wheelright::
ClipSaved1 := Clipboard
sleep, 100
clipboard :=
send, ^c
clipboard ++
send, ^v
x := Strlen(clipboard)
sendinput, {shift down}
send, {left %x%}
sendinput, {shift up}
clipboard :=
sleep, 100
Clipboard := ClipSaved1
return
wheelleft::
ClipSaved2 := Clipboard
sleep, 100
clipboard :=
send, ^c
clipboard --
send, ^v
x := Strlen(clipboard)
sendinput, {shift down}
send, {left %x%}
sendinput, {shift up}
clipboard :=
sleep, 100
Clipboard := ClipSaved2
return