Browse the docs

Element exists

Passes when a locator finds an Element in the front app.

Element locator exists

Details #

Looks for the Element in the front app's Accessibility tree. It passes when the locator resolves to something, using the same matching as the click and wait steps: role, title, identifier, path and alternatives. No clicking or waiting happens; the answer is immediate.

If the app isn't running or nothing is in front, the Element isn't there and the condition fails (a negated one passes).

Every condition accepts "negate": true, which flips the verdict. The trace records what was compared before the flip, so a negated condition that blocks a macro still shows the real values.

Conditions in an Only if list combine with all: every one must pass, and an empty list always passes. An if step or a repeat loop takes a match of all (default) or any.

The trace shows found and the locator's role.

Parameters #

ParameterTypeRequiredValuesWhat it does
locatorlocatorYesA locator object; role is required. Record one with the picker rather than typing it by hand.

Examples #

Only if a Save button is showing
When
  1. Press ⌃⌥J
Only if
  1. If Save button exists
Do
  1. Show “Save button found”
Open in Switchboard to try it
Where to look

Save button

In Switchboard, Pick an element fills this in for you.

Gotchas #

See also #