Wait Busy Window
Verb: waitBusy
Wait for a window, for a period of time, and check if it is busy or not.
Syntax
waitBusy [--window(Window)] [--sleepbefore(TimeSpan)] [--sleepafter(TimeSpan)] [--ignoreerror(Boolean)] [--timeout(TimeSpan)] (Boolean)=value
Inputs
| Script | Designer | Required | AcceptedTypes | Description |
|---|---|---|---|---|
| --window | Window | Optional | Window | Window that should be expected. |
| --sleepbefore | Sleep Before | Optional | Time Span | Wait time before checking if the window is occupied. |
| --sleepafter | Sleep After | Optional | Time Span | Wait time after checking if the window is occupied. |
| --ignoreerror | Ignore Error | Optional | Boolean | Prevents the error message from being displayed if the window is still busy. |
| --timeout | Timeout | Optional | Time Span, Number, Text | Command execution timeout.
If no value is defined in the parameter of type timeout, the execution uses the time defined by the Set Timeout command. If the script does not use this command, the default time is 5 seconds. The value entered in this parameter must be greater than the sum of the values entered in the Sleep After and Sleep Before parameters. If the time value entered is not sufficient for the command to determine whether the window is occupied or not, a timeout message will be returned. |
Outputs
| Script | Designer | AcceptedTypes | Description |
|---|---|---|---|
| value | Busy | Boolean | Returns "True" if the window is busy, or "False" if it is not. |
Example
The command assigns the window to the variable "paintWindow" and waits 5 seconds to check whether it is busy, with a 5 second retry check, and a maximum timeout of 30 seconds for complete execution. Returns, in the variable "busyWindow", "False" for busy window, or "True" for busy window.
defVar --name busyWindow --type Boolean
defVar --name paintWindow --type Window
launchWindow --executablepath "C:\\Windows\\system32\\mspaint.exe" paintWindow=value
// Check if the open window is busy.
waitBusy --window ${paintWindow} --sleepbefore 00:00:05 --sleepafter 00:00:05 --timeout 00:00:30 busyWindow=value
logMessage --message "Paint Window is Busy: ${busyWindow}" --type "Info"
closeWindow --window ${paintWindow}
// The return varies according to the current execution context. In the case of this example: False.