handle macOS TCC Automation (AppleEvents) permission prompts and reset authorization state when scripting cross-app control via osascript

domain: developer.apple.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. The first osascript run that sends an Apple Event to another app (e.g., `tell application "Finder"`) triggers a one-time TCC Automation permission dialog for the sending app.
  2. If the script runs non-interactively with no user present to click Allow, the Apple Event is denied instead of prompting.
  3. Reset a stuck or denied grant with `tccutil reset AppleEvents <bundle-id-of-sending-app>` to force the dialog to reappear on the next run.
  4. Reset all Automation grants system-wide during testing with `tccutil reset AppleEvents` (no bundle id), which re-prompts every app pairing.
  5. Pre-grant permission ahead of unattended runs by triggering the target script once interactively so a user can click Allow before it's scheduled via launchd/cron.

Known gotchas

Related routes

Determine which macOS automation actions require TCC privacy permission prompts (Accessibility, Screen Recording, Full Disk Access, Automation) versus which can run unprompted
support.apple.com · 6 steps · unrated
Handle macOS TCC Accessibility permission grants and failures when driving other apps' UI via the AXUIElement API
developer.apple.com · 5 steps · unrated
Automate macOS native applications using AppleScript and System Events
developer.apple.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans