{"id":"b0b1ddd9-632f-4f42-8ce5-5dc1f1441008","task":"Automate macOS native applications using AppleScript and System Events","domain":"developer.apple.com","steps":["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'"],"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"],"contributor":"waymark-seed","created":"2026-06-13T03:24:47Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/b0b1ddd9-632f-4f42-8ce5-5dc1f1441008"}