Wait for a Window
The Pause until winstatus pauses script execution until the specified window exists, not exists, is active, is not active. If after the specified timeout, the pause condition is not met, the block of statements following PauseFalse keyword is executed.Video: How to use Window Synchronization
Used to wait for the disappearance of a window generated by an application. For example, when you download a file, you could use Pause until "Completed" window disappears before performing further actions. Use Recording mode or Insert/Synchronization on window menu to generate easily such a Pause.
Pause [x secs] until
'If the condition is met, the optional statements after the PauseOK and before the PauseFalse are executed
' After the specified timeout, if the condition is not met, the statements after the PauseFalse are executed
MsgBox("Pause at line "+ #ErrorLine$ +" has failed !",16,"Runtime error")
|Keyword||Condition met when|
|Exists||The specified window exists|
|NotExists||The specified window does not exist|
|Active||The specified window is active (can receive actions)|
|NotActive||The specified window is not active|
|Exact||Triggers when an exact window name matches|
|Near||Triggers when a window name near from the specified one matches (default value)|
UseWindow function is enough to wait until the specified window is displayed, so do not use a Pause window for detecting a new window. If the window takes more than 30 seconds to appear, UseWindow will fail, but you can increase this default timeout using #ActionTimeout.
'This example just shows the Pause syntax.
'In this example, a UseWindow("NOTEPAD.EXE|#32770|Notepad") would be enough and much simpler
UseWindow("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1)
Pause 10 secs until
MsgBox("'Wait for' at line " + #ErrorLine$ + " has failed !")