Skip to main content
State commands extract information from UI elements without modifying them.

get text

Extract text content from an element.

Arguments

string
required
Target element: @ref (from snapshot) or app name

Options

string
Filter by accessibility role
string
Filter by title
string
Filter by label
integer
default:"0"
Which matching element to read (0-indexed)
boolean
Output as JSON

Examples

Output

The command reads from AXValue, AXTitle, or AXDescription attributes in that order, returning the first available value.

get value

Get the current value of an input element.

Arguments and options

Identical to get text.

Examples

Output

For checkboxes and numeric controls:
Checkboxes return 0 (unchecked) or 1 (checked). Sliders and steppers return their numeric value.

get attr

Retrieve a specific accessibility attribute.

Arguments

string
required
Target element: @ref or app name
string
required
Attribute name (e.g., AXRole, AXEnabled, AXFrame, AXPosition)

Options

Standard filter options: --role, --title, --label, --index, --json

Examples

Output

For position/size:
For arrays:

Common attributes

  • AXRole - Element type
  • AXRoleDescription - Human-readable role
  • AXTitle - Element title
  • AXDescription - Accessibility description
  • AXIdentifier - Unique identifier
Use inspect to see all available attributes for an element.

get title

Get the title of the frontmost window of an application.

Arguments

string
required
Application name or bundle identifier

Options

boolean
Output as JSON

Examples

Output


is enabled

Check if an element is enabled (interactive).

Arguments

string
required
Target element: @ref or app name

Options

Standard filter options: --role, --title, --label, --index, --json

Examples

Output

or
Use this in scripts to conditionally perform actions based on element availability.

is focused

Check if an element currently has keyboard focus.

Arguments and options

Identical to is enabled.

Examples

Output

or

Workflow examples

Verify form submission

Monitor dynamic content

Extract structured data

Validation checks

Compare states