Skip to main content
End-to-end examples demonstrating common automation patterns with agent-native.

Calculator automation

Automate the macOS Calculator app to perform calculations.

Basic calculation

Perform a simple calculation: 5 + 3 = 8

Using filters instead of refs

Same calculation using title filters:

Complex calculation

Perform (15 + 7) × 2:

TextEdit automation

Automate TextEdit for document creation and editing.

Create and save a document

Find and replace

Format text

Finder automation

Automate Finder for file management tasks.

Create new folder

Search for files

Change view options

Safari automation

Automate Safari for web browsing tasks.

Fill form and submit

Open multiple tabs

Check if element exists

System Settings automation

Automate System Settings (formerly System Preferences).

Toggle setting

Change dropdown setting

Advanced patterns

Conditional automation

Retry with timeout

Parallel automation

Loop through elements

Wait for element with custom logic

Debugging tips

Start with a snapshot to see all available elements:
This shows you the refs and structure you can interact with.
The tree command shows the full accessibility hierarchy:
Increase depth to see more nested elements.
Use inspect to see all attributes and available actions:
This shows you exactly what attributes you can filter by.
Some UI elements need time to respond:
The wait command is more reliable than sleep:
Use --json flag for easier parsing: