Chapter 2. Using Script Editor

If you’re going to write and edit AppleScripts, you’re going to need some sort of program to help you out. For that, Apple has graciously supplied you with the aptly named Script Editor program. Script Editor is AppleScript’s bread and butter—the program you’ll use for just about everything as you learn the language. It’s a text editor, script runner, documentation viewer, and antifreeze solution, all rolled into one. And although there are other AppleScript editors available (listed on Sidebar 2.6), you’ll be best off sticking with Script Editor for now—if only because it’s free and included with your computer.

You can start Script Editor in several ways:

  • Double-click its icon in the Applications AppleScript folder.

    Since you’re going to be using Script Editor a lot, you might even like to store its icon in the Dock or the Finder’s Sidebar, where you’ll have easy access at a moment’s notice.

  • Open a script anywhere on your computer.

    You can drag a script from your Library Scripts folder to Script Editor’s icon, for example.

  • In the Script Menu, choose Basics Open Script Editor.

    This is the best method if you’re tight on screen space, because you don’t have to open any new windows.

The Script Editor Look

As you can see from Figure 2-1, Script Editor’s window is fairly basic, especially when compared to something like Photoshop or Microsoft Word. Along the top of the window, you’ll see a toolbar with four simple buttons (Record, Stop, Run, and Compile), ...

Get AppleScript: The Missing Manual 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.