Reputation: 1510
I am trying to create a Hotkey (Ctrl+l) to do following:
Click Enter on that option.
^l::MouseClick, right Sleep, 1000 Send, {DOWN 2}{ENTER}
Problem:
The problem is that ONLY the Right Click command works and brings up the Context Menu successfully but Down doesn't work at all, so NO OPTION is Selected from the menu.
Additional Info:
I found that if context menu is already there and then if I run following script:
Send, {DOWN 2}{ENTER}
It selects the option Successfully. But I need both Right Click and Selection of Option to be done by single Hotkey.
What am I doing wrong ?
Upvotes: 0
Views: 1488
Reputation:
If you declare your hotkeys with command in the same line only that line will be executed
^l::MouseClick, right ; only this line is executed
Sleep, 1000
Send, {DOWN 2}{ENTER}
Compared to this:
^l::
MouseClick, right
Sleep, 1000
Send, {DOWN 2}{ENTER}
return
All lines get executed.
Upvotes: 2
Reputation: 7953
You wrote MouseClick, Right
in the same line as ^l::
, this way ONLY the first line is executed.
^l::
MouseClick, right
Sleep, 100
Send, {DOWN 2}{ENTER}
Return
Upvotes: 2