Repository navigation
scriptview shows you the source code of compiled AppleScript files, on macOS, Linux and Windows. This is the first release I'm announcing, so here's everything it does.
What it reads
- Compiled scripts (
.scpt), script bundles (.scptd) and applets (.app). The output matchesosadecompileline for line on all 194 scripts that ship with macOS, and on 6,133 of 6,142 scripts from public GitHub repositories. - Run-only scripts, which have no source in them at all. scriptview rebuilds the source from the bytecode. Comments and formatting are gone for good, but the code comes back: compile the result again and about 80 to 90% of scripts give identical bytecode.
- Classic Mac OS scripts, back to AppleScript 1.0 in 1993. Current macOS refuses to open many of these. scriptview finds the script in the resource fork, in
._namefiles and__MACOSXfolders, and in MacBinary and BinHex files. - JavaScript for Automation scripts, and
.scptfiles that are only plain text.
Use
scriptview MyScript.scptThat prints the source. Run scriptview help for the other commands, such as disasm for the bytecode.
Download
Pick the file for your system below and unpack it. The macOS binaries are signed and notarized, so they run without a security warning. The Linux and Windows ones are plain binaries.
With Go installed, you can also run go install github.com/trypsynth/scriptview/cmd/scriptview@latest.
Limitations
Terms from apps that don't ship with macOS print as raw codes, like «class pURL». Old Japanese scripts come out with garbled text. The README has the full list.
How it was made
Claude, an AI model, wrote most of the code and the notes. I directed the work, reviewed it, and pushed back when it was wrong. The docs folder has everything we learned about the format along the way. Much of it wasn't written down anywhere before.