Inspect an application's AppleScript scripting dictionary and decompile a saved compiled script back to readable source
domain: developer.apple.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Open the target application's scripting dictionary in Script Editor (File > Open Dictionary) to browse the commands, classes, and properties it defines.
Alternatively extract an app's dictionary definition from the command line with `sdef /Applications/AppName.app`, which prints the underlying XML scripting definition (sdef format).
To read a compiled script (.scpt) or script bundle whose source text isn't visible, run `osadecompile <file>` to print its AppleScript source back to text.
Cross-reference class and command names from the decompiled/dictionary output against the app's own dictionary before writing new automation, since AppleScript terminology differs per app.
Confirm the script wasn't saved as run-only (compiled without embedded source); only scripts that retain their source can be recovered with osadecompile.
Known gotchas
sdef output is per-app terminology, not a generic API reference, so commands/objects available in one app's dictionary won't work when scripting a different app.
A script saved as run-only (compile without source) cannot be recovered with osadecompile; the readable source is discarded at save time, not merely hidden.
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?