I have a small script that what it does is to repeat the sending of the keys J and A, triggered by two HotKeys, 1 and 2. The question is that before all this starts a dialog box is shown that asks the user how many times the loop will be repeated, but as my keys 1 and 2 are already reserved as HotKeys, they can not be used. Is there any way to tell AHK to wait until the dialog box closes to reverse the HotKeys?
Code: Select all
#SingleInstance, Force
SendMode Input
Beggin:
InputBox, UserInput, Phone Number, Please enter a loop number (Using the NumPad keys)., , 300, 150
if ErrorLevel{
MsgBox, CANCEL was pressed.
ExitApp
}
1::
Loop, %UserInput%
{
Send, {A}
Sleep, 10
}
return
2::
Loop, %UserInput%
{
Send, {J}
Sleep, 10
}
return
Esc::
MsgBox, 4,, Would you like to continue? (press Yes or No)
IfMsgBox Yes
Goto, Beggin
else
ExitApp