I have an AppleScript that KM runs at periodic intervals. This morning, after updating to MacOS 26.5, KM started giving me errors that the script file wouldn’t run. I tried to open it in Script Editor, but it says, “The document could not be opened.” (with the name of the script replaced with )
The file in the Finder shows at 74 KB, but in the terminal it shows zero bytes.
Even stranger, I have a bunch of Time Machine backups of the file, but they all show up the same in Finder/Terminal, and none of them open either. Other AppleScripts in the same folder open just fine. This is the only file in that folder that shows zero bytes.
The script worked fine yesterday.
This is also the only one that KM runs automatically at intervals. Is there any chance that KM damaged the script somehow?
I’m definitely not out of disk space, 300 GB free on a 1 TB SSD.
But I got it fixed. Script Debugger was able to open the file, and I copy/pasted the source back into a new Script Editor window.
This script was originally created in 2001, so AI thinks that it was saved as an old format that MacOS 26.5 no longer supports. So this solution may be helpful for some other old-timers like me.
Glad it works. It remains strange that you saw a zero bytes file in the terminal. That was what I was focussing on. Anyway, it works that is most important.
Files with the .applescript extension are source text, and don't encounter this problem.
Files with the .scpt extension are, however, compiled into an intermediate byte-code, which does not always match the requirements of a newer version of macOS.
Always keep a source code version from which you can Save As to a .scpt copy – recompiling to a version that will work on a new iteration of macOS.
The discussion also links to a paper on the history of AppleScript by William R. Cook (no relation, I presume) and just a tiny bit more about the osadecompile shell command that @acekm highlighted.