Introducing AppleScript Editor

For creating and editing AppleScript scripts, you can use the AppleScript Editor utility included with OS X. AppleScript Editor also can run scripts and make scripts into self-contained applications that run when you double-click them in the Finder. AppleScript Editor normally is located in the Utilities folder in the Applications folder.

Tip

If you end up doing lots of scripting, you may want to replace AppleScript Editor with a more capable script development application, such as Script Debugger from Late Night Software ($199; www.latenightsw.com). Make sure you get the version made for OS X.

Scriptable applications and environments

The scripts you create with AppleScript Editor can control any scriptable application. A prime example of a scriptable application is the Finder. Other scriptable applications that come with OS X include Calendar, ColorSync Utility, iTunes, Mail, Messages, QuickTime Player, Safari, Spotlight, System Information, Terminal, and TextEdit. Interestingly enough, even AppleScript Editor is scriptable. In addition, many OS X applications—both those from Apple and from other companies—are scriptable.

Looking at a script window

When you open AppleScript Editor, an empty script window appears. Each script window can contain one script. The top part of the script window is the script editing area, where you type and edit the text of the script just as you type and edit in any text-editing application. The bottom part of the window ...

Get OS X Mountain Lion Bible 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.