Wait
Pauses for a number of seconds, or waits until an element, window or app appears or goes away.
Wait pause seconds
Keyboard Maestro: Pause, PauseUntil
Details #
Wait has four forms. Which one runs depends on the params. The pause form is chosen first, then these are checked in order:
A pause.
pauseis set, with nolocator,windoworapp: wait that many seconds, then go on. A pause runs as long as it says, up to what is left of the macro's own timeout; it isn't cut at the 10 seconds a step gets by default.An element.
locatoris set: wait until it exists. Withgone, wait until it no longer exists.A window.
windowis set: wait until a window of the app has that title (or a title containing it, ignoring case). Withgone, wait until no window has it.An app. Only
appis set: wait until the app is running. Withgone, wait until it has quit.
Waiting for a condition polls the screen until it is true or the step's timeout runs out. The default timeout is 10 seconds. Set timeout on the step, or in its params, to change it. On timeout the step fails and the Trace shows what it looked for and what it found instead.
An element wait does not require the element to be enabled. The output reports the match and how long the wait took.
Prefer waiting for what you need next over a fixed pause. A pause is always as long as you set it. A wait ends the moment the thing is there.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
app | text | A bundle id. With locator or window, it says which app to look in. Alone, it is the app to wait for. | ||
fuzzy | yes / no | For element waits, accepts a match between 40% and 70% instead of failing. It is flagged "fuzzy match" in the Trace. | ||
gone | yes / no | Wait for the thing to disappear instead of appear. | ||
locator | locator | The element to wait for. Select the step and press Re-record in the editor, then click the element. | ||
pause | number | Seconds to wait. Used alone. | ||
timeout | number | Seconds to wait before giving up. The default is 10. | ||
window | text | A window title, or part of one. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
- Wait 1 s
- Show “Done” for 1 s
Open Notes and wait until its window is up before the next step:
- Activate ‹app›
- Wait for window “Notes”, up to 15 s
Gotchas #
pausetogether withlocator,windoworappis not a pause. The locator, window or app wait runs andpauseis ignored.A step with none of these fails with "needs a locator, a window, an app or a pause".
A dry run skips waits unless you mark the step Safe in dry run.