|
MacOS.OSA object
The MacOS.OSA object allows you to invoke other OSA scripting languages,
such as AppleScript or Fronter, directly from within JavaScript.
| Method/Property |
Description |
| MacOS.OSA(language) |
constructor
Specify the language you want to use:
MacOS.OSA.AppleScript
MacOS.OSA.Frontier
MacOS.OSA.Generic (if you don't care)
or the 4-character code identifying the language (e.g. "ascr"
for AppleScript)
|
| MacOS.OSA.compile(source) |
compile a script
|
| MacOS.OSA.execute() |
execute the script and return the value produced
by the script
|
| MacOS.OSA.call(subroutineName, ...) |
call a subroutine, and optionally pass parameters
and return the value of the subroutine
|
MacOS.OSA.toSource()
MacOS.OSA.toString() |
decompile the script
|
| MacOS.OSA.load(path) |
load a previously compiled script from a file
|
| MacOS.OSA.store(path) |
store a script in a OSA script file (new in 1.0.2) |
| MacOS.OSA.modified |
read-only
this property returns the modification count of the script.
|
In addition to the methods and properties defined above, any properties
or handlers present in the loaded or compiled OSA script are available
as properties or functions of the MacOS.OSA object. For instance:
|
Sample
|
var script = new MacOS.OSA(MacOS.OSA.AppleScript);
script.compile("property abc:\"Hello World\"");
script.abc; |
|
The result of this script fragment is the value of the AppleScript ABC
property: "Hello World".
|