LNS Home
JavaScript OSA
JavaScript OSA Home
Download & Installation
QuickStart
Project Status
Documentation
 
Object Reference
 
Core
MacOS
MacOS.AEDesc
MacOS.AEApp
MacOS.AEClass
MacOS.AEColl
MacOS.FileSpec
MacOS.OSA
MacOS.MacOSError
Sending Raw AppleEvents
Responding to AppleEvents
AppleEvent to JavaScript Value Conversion
How-Tos
 
Open Handler
Folder Actions Handlers
Write Some Text
Calling JavaScript from REALbasic
Using JavaScript Libraries
FAQ
Mailing List
JavaScript Language Documentation & Links
Products
Affrus 1.0
x FaceSpan 4.3
Script Debugger 4.0
Site Contents
Home Page
bullet Mark’s Blog
Product Registration
Bug Reporting
x Freeware
Contacting Us

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".


Copyright © 1998-2007 Late Night Software Ltd. - All Rights Reserved.