Ui Click
ui_clickClicks an element (by element_ref, at its center) or a screen coordinate (by coords). button left|right, count 2 = double-click. Returns {clicked, at:{x,y}} — clicked means the click event was POSTED at those coordinates, NOT that the app acted on it: CGEvent carries no delivery confirmation, so a busy, modal or input-ignoring app reports exactly the same success. Confirm the effect with ui_wait_for_element or ui_read_tree rather than trusting clicked. element_disabled is returned ONLY when the app actually publishes AXEnabled=false; a control that does not publish AXEnabled at all is treated as unknown and clicked. Requires Accessibility permission.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | No | Default element if element_ref given, else coords. | |
| count | No | 1 (default) or 2 for double-click. | |
| button | No | Default left. | |
| coords | No | {x,y} in global screen points. | |
| element_ref | No |