Chapter 14: Using AppleScript and Automator

In This Chapter

Understanding how OS X messages and events let scripts work

Understanding the AppleScript language

Using the AppleScript Editor application to create scripts

Creating, analyzing, and saving basic scripts

Developing drag-and-drop script applications

Accessing scripts via the Scripts menu

Using AppleScript to run programs on other Macs

Using Automator to create programming-free workflows

Although you may be impressed by components in all the technologies that come with OS X, individually, the components don't do much by themselves—they tend to require user input. Scripting has long been a way to coordinate the different components of a task by enabling you to compose a script that plays back a set of commands in order.

OS X's AppleScript scripting language is a simplified programming language that lets you control your applications and perform tasks automatically. Scripts range from the simplest to the highly complex, depending on your skill at scripting, your knowledge of AppleScript's nuances, and the requirements of your task. This chapter contains enough information about AppleScript that even a scripting novice can get scripts up and running.

I begin by showing the underlying technologies that make AppleScript possible: messages and events. Then it's on to an introduction of AppleScript and a look at the tools that let you run, modify, and create scripts of your own. Finally, I run through a few basic scripts, to ...

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.