I would like:
1. Open MessageBox
2. Wait 1-90 second
3. Typing some code
4. Run program
4. Wait few second for Window
5. If Windows is opened, click OK
6. If i cancel or timeout is out, i don't wont to exit this script.
Now is working not correct, if MessageBox is few second aktiv, on step 6 ist OK pressed. If MessageBox is only short time aktiv, OK button is not pressed.
Code: Select all
^q::
InputBox, code, Input code dialogue, Please enter your code, ,200, 140, , , local ;
if ErrorLevel
MsgBox, CANCEL was pressed.
Run C:\Program Files\Viscosity\Viscosity.exe
WinWait, ahk_class HwndWrapper[Viscosity.exe;CwpfDetails;1321437b-4494-40a9-acd7-65d649b10046],, 90
if ErrorLevel
{
MsgBox, WinWait timed out.
return
}
else
MsgBox, Viscosity is opened
continue
ControlClick, OK, Viscosity
return