Browse the docs

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 #

ParameterTypeRequiredValuesWhat it does
conditionconditionYesRequired. Any condition, written as in Only if.
holdnumberSeconds the condition must stay true. Default 0.
intotextA variable that receives {met, after}.
timeoutany valueHow 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 for the VPN network, then open the wiki
Do
  1. Wait until Wi-Fi is “Office”
  2. If met is true
  3. Open wiki.example.com
Open in Switchboard to try it

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