I want to compile and de-compile AppleScript from the command-line, so I can put the text-files into
git. However, I run into problems with a Scripting Library that contains sdef (Scripting Definition) files.
When I perform
decompile MyLib.scptd/Contents/Resources/Scripts/main.scpt, I get output like:
use AppleScript version "2.4" use scripting additions on «event ABCDEFGH» my_argument --... end «event ABCDEFGH»
which is fine i guess, since the raw commands (
«event ABCDEFGH») it the textual and runnable representation of the source code of the Scripting Library. (the event ABCDEFGH is obviously an example; I use other codes but for sake of simplicity…)
However, how do I compile this source back into a script library, I can’t get it to use my script definition file.
osacompile doesn’t have an argument for an sdef-file. When I pass the sdef-file as a 2nd argument,
MyLib.sdef:1: error: A “<” can’t go here. (-2740).
Is it at all possible to do this I want from the command line, and if so, how?