Name
osacompile
Synopsis
osacompile [-llanguage] [-ecommand] [-oname] [-d] [-rtypeid] [-ttype] [-ccreator] [file...]
Compiles into a new script file one or more text or compiled OSA script files or standard input.
Options
-
-ccreator Assign the four-character file-creator code
creatorto the new script (the default isosas).-
-ecommand Use
commandas a line of script to be compiled. You can use more than one-eoption; each will specify a new line of script.-
-ipathname Use the dictionary from the application
pathnamewhen compiling.-
-lOSAlang Use OSA language
OSAlanginstead of the default AppleScript. Use theosalangcommand (described later in this chapter) to get information on all of the system’s OSA languages.-
-oname Use
nameas a filename for the new script instead of the defaulta.scpt.-
-rtype:id Place the resulting script in the resource fork of the output file, in the resource specified by
type:id.-
-ttype Assign the four-character file-type code
typeto the new script (the default isosas).-
-x Save file as execute only. This doesn’t produce an applet, but a compiled script file that can’t be viewed in Script Editor.
Examples
Use the filename newscript for a new script
file, compiled from the source in
scripttext.txt:
$ osacompile -o newscript scripttext.txtCompile the file scripttext.txt into a compiled
script called newscript (assuming that a
JavaScript OSA scripting component exists on the system):
$ osacompile -l JavaScript rawscript.txtBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access