Now that AppleScript no longer requires a WindowServer connection, and
static sdefs can be used for terminology without launching their
containing app, we're once again attempting to build our Automator
actions as part of our build process. Unfortunately, osacompile
doesn't seem to want to be given an sdef, insisting on finding the
application for itself. (The app in question still uses old-style
.scriptTerminology, but it's no big deal for me to manually run
sdef(5) if it means that the actual compilation happens automatically
on our build server.)
Has anyone been able to compile their scripts headlessly?
I don’t think this is possible, but would be happy to be wrong.
I don’t have a situation where I need to build headlessly, but I do
have 2 situations in which it would be nice to do this:
1) Chicken and egg problem where building automator actions for
Product X requires Product X in order to compile the scripts
2) Building Product Y compiles a script that talks to any number of
apps which may not be on every build machine.
To solve problem #2, I just write the portion of the scripts which
address applications not part of a stock Mac OS X install using raw
chevron syntax. It isn’t necessarily pretty, and requires
understanding how how AppleScript generates object specifiers (because
sometimes you need to throw in an ‘of it’ where you wouldn’t need to
when using english syntax), but it gets the job done.