Open Script Editor (in /Applications/Utilities) or run scripts via osascript in Terminal
Target an application by name: tell application 'Finder' to activate
Interact with GUI elements via System Events: tell application 'System Events' to tell process 'Finder' to click button 'OK' of window 1
Read and set text field values: tell application 'System Events' to set value of text field 1 of window 'My App' to 'hello'
Use keystroke for apps without accessible UI controls: tell application 'System Events' to keystroke 'v' using command down
Run from Terminal for automation pipelines: osascript -e 'tell application "Calendar" to quit'
Known gotchas
macOS requires explicit Accessibility permission for the script runner (Terminal, Script Editor, or your app) under System Settings > Privacy & Security > Accessibility; missing this permission causes silent failures
AppleScript's GUI scripting via System Events is brittle to UI layout changes — button names and element indices shift between macOS versions; prefer app-native AppleScript dictionaries (tell application 'Finder' to...) over System Events where available
Sandboxed applications obtained from the Mac App Store may not expose a full AppleScript dictionary or GUI scripting surface; test against the direct-download version when automation is blocked
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp