Ui Find Element
ui_find_elementGUI automation — control a native app's interface. Finds an element (button, field, menu…) in an app's accessibility tree by role and/or label. Scope with app_bundle_id or window_id. Returns an opaque element_ref (usable by ui_click / ui_get_element this session) plus role, label, bounds, focused, and enabled only when the app publishes AXEnabled (otherwise enabled_unknown: true, which does NOT mean disabled). An element with no position and no press action (a label inside a web page) gets the ref of the pressable link or button that contains it (ref_via:"ancestor"), or no element_ref and clickable:false when there is none: click it by coords. found=false when the app is reachable but no element matches; app_not_found is an explicit error. Requires Accessibility permission.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | AX role, e.g. AXButton, AXMenuItem, AXTextField. | |
| index | No | Which match to return if several (default 0), counted after the exact-first ordering. | |
| label | No | AX title/description to match. | |
| match | No | Default contains. With contains, a label that equals the query (ignoring case and spacing) is preferred over longer labels that merely contain it (label "Reply" returns "Reply", not "Reply All"). When several elements match equally well the response has ambiguous: true and the candidates; the first is still returned. | |
| window_id | No | Alternatively scope by a window_id from list_windows. | |
| app_bundle_id | No | Scope the search to this app. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||