Wait until a condition holds
Waits for any condition to become true, using the engine's watcher instead of a polling loop; returns whether it was met and how long it took.
Wait until condition
Details #
Stops the macro until the condition has been true for hold seconds, or until timeout. The condition is read only when something that could change it happens, so it costs nothing in between. A condition that is already true counts (after the hold).
It does not fail when the time runs out: it returns met: false, so the macro can decide. The step leaves met and after (seconds waited) and the object under into.
waitFor is the older step that waits for one element on screen. wait.until works with any condition.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
condition | condition | Yes | Required. Any condition, written as in Only if. | |
hold | number | Seconds the condition must stay true. Default 0. | ||
into | text | A variable that receives {met, after}. | ||
timeout | any value | How long to wait: 30s, 5m or seconds. Default 60 s. The macro's own timeout still applies. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
- Wait until Wi-Fi is “Office”
- If met is true
- Open wiki.example.com
Gotchas #
Dry run. The condition is taken as met at once.
A condition that cannot be watched (AI conditions) fails the step with the reason.
Raise the macro's timeout (Run settings) if you wait longer than it allows.
See also #
Wait, Run a macro later, A condition becomes true, Triggers that watch: becomes true, States, waiting runs