Skip to content

Element Mode

Element Mode is used to move between clickable elements such as links, buttons, and text fields. What happens after selecting an element depends on the command you used in Command Mode or from a shortcut.

For example, if you enter Element Mode through command.moveCursorToElementAndLeftClick, selecting an element will move the cursor to that element and perform a left click.

When Element Mode is active, clickable elements in the active window are highlighted and assigned letter hints. Type the hint to jump the cursor to the target element.

Element Mode

You can also press Enter to trigger the post-action right below the current mouse position.

OCR elements can act as a fallback when a window does not expose enough information through the Accessibility API.

You can also press Tab to switch between OCR and Accessibility sources.

  • Accessibility elements are the default source.
  • Some windows, such as apps like Maps, may expose only part of their content through Accessibility. In those cases, you can switch to the source that works best for the current window.

This makes Element Mode more useful when a window does not fully expose its contents through Accessibility, or when you want to pick the source that gives you the most complete result.

Element Mode can also search beyond the frontmost window in some cases:

  • It can include clickable elements from the previous window in the current Space.
  • It can include clickable elements from favorite windows.
  • It can include Finder desktop items.
  • It can include Dock items, and still provide a target when the Dock is auto-hidden.

This makes it easier to keep using the keyboard when the target is not inside the current focused window.

Favorite windows are managed from Element Menu Mode. Use command.enterElementMenuModeForFocusedWindow to open the menu for the focused window, then choose Favorite Window.

CommandIdentifierAction
command.moveCursorToElementMove cursor to element
command.moveCursorToElementAndLeftClickMove cursor to element and left click
command.moveCursorToElementAndDoubleLeftClickMove cursor to element and double left click
command.moveCursorToElementAndMiddleClickMove cursor to element and middle click
command.moveCursorToElementAndRightClickMove cursor to element and right click