Script Editor App: Write and Edit AppleScripts in macOS Sierra

By Bob LeVitus

Describing AppleScript to a Mac beginner is a bit like three blind men describing an elephant. One man might describe it as the Mac’s built-in automation tool. Another might describe it as an interesting but often-overlooked piece of enabling technology. The third might liken it to a cassette recorder, recording and playing back your actions at the keyboard. A fourth (if there were a fourth in the story) would assure you that it looked like computer code written in a high-level language.

They would all be correct. AppleScript, a built-in Mac automation tool, is a little-known (at least until recently) enabling technology that works like a cassette recorder for programs that support AppleScript recording. And scripts do look like computer programs. (Could that be because they are computer programs? Hmm… .)

If you’re the kind of person who likes to automate as many things as possible, you might just love AppleScript because it’s a simple programming language you can use to create programs that give instructions to your Mac and the applications running on your Mac. For example, you can create an AppleScript that launches Mail, checks for new messages, and then quits Mail. The script could even transfer your mail to a folder of your choice. Then there’s Automator, which includes a whole lot of preprogrammed actions that make a task like the one just described even easier.

AppleScript is a time-and-effort enhancer. If you just spend the time and effort it takes to understand it, using AppleScript can save you oodles of time and effort down the road. Therein lies the rub. This stuff is far from simple; entire books have been written on the subject. Still, it’s worth finding out about if you’d like to script repetitive actions for future use. To get you started, here are a few quick tips:

  • Script Editor (in the Utilities folder inside the Applications folder) is the application you use to view and edit AppleScripts. Although more information on Script Editor is beyond the discussion here, it’s a lot of fun. And the cool thing is that you can create many AppleScripts without knowing a thing about programming. Just record a series of actions you want to repeat and use Script Editor to save what you recorded as a script. If you save your script as an application (by choosing Format  →  Application in the Save sheet), you can run that script by double-clicking its icon.
  • You can put frequently used AppleScripts in the Dock or on your Desktop for easy access.
  • Many AppleScripts are designed for use in the toolbar of Finder windows, where you can drag and drop items onto them quickly and easily.
  • Scripts can enhance your use of many apps including iTunes, iPhoto, and the Finder, to name a few.
  • Apple provides a script menu extra that you can install on your menu bar in the Script Editor’s Preferences window, along with a number of free scripts to automate common tasks (in the Scripts folder in the root-level Library, or choose Open Example Scripts Folder from the Script Editor’s Help menu).
  • If the concept of scripting intrigues you, explore the examples in the Scripts folder (in the root-level Library or choose Open Example Scripts from the Script Editor’s Help menu). Rummage through this folder and when you find a script that looks interesting, double-click it to launch the Script Editor program, where you can examine it more closely.