I'm trying to get it so that when I press Shift+w windows reacts as if i have pressed:
Ctrl+r
down arrow key 5 times
enter
I can't figure out which operators to use.
Script to do a series of key inputs?
- Learning one
- Posts: 173
- Joined: 04 Oct 2013, 13:59
- Location: Croatia
- Contact:
Re: Script to do a series of key inputs?
Code: Select all
$+w:: ; registers Shift+w hotkey ($ forces keyboard hook)
Send, ^r ; sends Ctrl+r
Send, {Down 5} ; sends down arrow key 5 times
Send, {Enter} ; sends enter
return ; finishes hotkey subrputine
My Website • Join DropBox
Re: Script to do a series of key inputs?
Is there any way to do this only when in a specific program?Learning one wrote:Code: Select all
$+w:: ; registers Shift+w hotkey ($ forces keyboard hook) Send, ^r ; sends Ctrl+r Send, {Down 5} ; sends down arrow key 5 times Send, {Enter} ; sends enter return ; finishes hotkey subrputine
Re: Script to do a series of key inputs?
#IfWinActive, Notepad
$+w:: ; registers Shift+w hotkey ($ forces keyboard hook)
Send, ^r ; sends Ctrl+r
Send, {Down 5} ; sends down arrow key 5 times
Send, {Enter} ; sends enter
return ; finishes hotkey subrputine
Just add "#IfWinActive, WindowName" at the beginning.
$+w:: ; registers Shift+w hotkey ($ forces keyboard hook)
Send, ^r ; sends Ctrl+r
Send, {Down 5} ; sends down arrow key 5 times
Send, {Enter} ; sends enter
return ; finishes hotkey subrputine
Just add "#IfWinActive, WindowName" at the beginning.
Re: Script to do a series of key inputs?
I see, but what if the window name in the program changes depending on the file that is open? This is how it works in Adobe Bridge, which is what I'm trying to use it in.dccostac wrote:#IfWinActive, Notepad
$+w:: ; registers Shift+w hotkey ($ forces keyboard hook)
Send, ^r ; sends Ctrl+r
Send, {Down 5} ; sends down arrow key 5 times
Send, {Enter} ; sends enter
return ; finishes hotkey subrputine
Just add "#IfWinActive, WindowName" at the beginning.
- Learning one
- Posts: 173
- Joined: 04 Oct 2013, 13:59
- Location: Croatia
- Contact:
Re: Script to do a series of key inputs?
Then use Window Class. For example: #IfWinActive ahk_class Notepad
My Website • Join DropBox
Who is online
Users browsing this forum: Google [Bot], marypoppins_1, ShatterCoder and 144 guests