The WinWait function can be used to make the script pause, until a specified window opens. Useful if the execution of your script depends on a specific program running.
The check is performed around every 250 milliseconds.
|title||Title, hWnd or class of the window to check.|
|text||Optional. Text to check for.|
|timeout||Optional. The timeout is in seconds.|
The following script will wait for 20 seconds, to see if notepad opens, and close it if it dose, but exit if it doesn't.
Run("notepad.exe") WinWait("[CLASS:Notepad]", "", 10) sleep(5000) WinClose("[CLASS:Notepad]")