Chapter 1. AppleScript: An Introduction

AppleScript is a scripting tool that installs with the Mac OS, including the newest release, Mac OS X. Programmers and power users use AppleScript to create scripts and applets, which are small Mac programs that can both accomplish useful tasks on their own and greatly extend the capabilities of other software systems.

This chapter covers the following topics:

  • How AppleScript is used (for example, for software automation and the attaching of scripts within an application’s menus).

  • An overview of Apple events, a messaging technology that AppleScript uses to control scriptable applications. This section briefly describes (1) how AppleScript code sends Apple events, as well as (2) Apple event classes and objects.

  • Two applications that you can use to access and run your scripts from the file system: Script Runner (for Mac OS X) and OSA Menu (Mac OS 9). Chapter 2, is completely devoted to Script Editor, which is the script development environment that installs with the Macintosh OS.

  • AppleScript’s language elements, such as data types, variables, handlers (i.e., subroutines or functions), and flow-control statements. This is a “quick reference” for the readers who want to dispense with narrative and dive right into scripting. Part II then covers all of these elements in detail.

Get AppleScript in a Nutshell 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.