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
-
-c
creator
Assign the four-character file-creator code
creator
to the new script (the default isosas
).-
-e
command
Use
command
as a line of script to be compiled. You can use more than one-e
option; each will specify a new line of script.-
-i
pathname
Use the dictionary from the application
pathname
when compiling.-
-l
OSAlang
Use OSA language
OSAlang
instead of the default AppleScript. Use theosalang
command (described later in this chapter) to get information on all of the system’s OSA languages.-
-o
name
Use
name
as a filename for the new script instead of the defaulta.scpt
.-
-r
type:id
Place the resulting script in the resource fork of the output file, in the resource specified by
type:id.
-
-t
type
Assign the four-character file-type code
type
to 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.txt
Compile 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.txt
Get Mac OS X Panther in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.