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

JavaScript OSA QuickStart

Once you have installed the JavaScript OSA extension in your extensions folder, and rebooted your Macintosh, you are ready to start scripting with JavaScript.

Step 1 - Choose the JavaScript language

In the Script Editor, there is a popup menu in the lower left corner of the script window that lets you select a scripting language. Use this menu to choose JavaScript.

Step 2 - Enter a simple script

At this point, you can enter any valid JavaScript statements. Here is a script that returns the text "Hello World".

And that's it. You've written your first JavaScript script on the Mac. You can explore the JavaScript OSA documentation to learn about the MacOS-specific features of the JavaScript OSA implementation. These facilities allow you to control any scriptable Macintosh application directly from JavaScript.

To get you started, here's a script which uses the Finder to gather the names of all the files on your desktop. You can also look at the scripts in the Samples folder included in the JavaScript OSA distribution.


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