Previous Page
Next Page

How This Book Is Organized

This book is divided into four sections, as follows.

Part I, AppleScript Overview

Part I consists of general introductory material, explaining what AppleScript is, motivating the reader with examples of various ways and means for putting AppleScript to use, and defining fundamental terms that the reader will need to understand.


Chapter 1, Why to Use AppleScript

Provides some motivational guidelines and real-life examples intended to answer such big existential questions as what AppleScript is good for and why you would want to use it anyway.


Chapter 2, Where to Use AppleScript

Surveys the various areas of the computer where AppleScript can be employedfor example, by running a script in the Script Editor, by calling into AppleScript from some application's internal scripting language, or by way of a Unix scripting language like Perl.


Chapter 3, Basic Concepts

An explanation of the technologies underlying AppleScript and a glossary of fundamental terms. This is where the technical discussion starts. The rest of the book depends upon the facts and definitions laid down in this chapter.

Part II, The AppleScript Language

Part II develops AppleScript as a programming language. Learners should read the chapters in order; experienced users may employ this section as a linguistic reference.


Chapter 4, Introducing the Language

A subjective description of what AppleScript is like as a language, just to give you a sense of what you're getting into.


Chapter 5, Syntactic Ground of Being

Describes some fundamental externals of the language, such as lines and comments.


Chapter 6, A Map of the World

Surveys the consituent parts of an AppleScript program (as discussed in detail in the ensuing four chapters).


Chapter 7, Variables

Discusses how to assign and define variables and how their names should look.


Chapter 8, Script Objects

Discusses script objects (scripts within scripts), including how to refer to them, how to load and save them dynamically, and how inheritance works.


Chapter 9, Handlers

Shows how to declare and call handlers (subroutines), along with some powerful and interesting advanced devices for passing parameters and returning values.


Chapter 10, Scope

Discusses the visibility and storage of declared and undeclared variables, along with some advanced techniques involving free variables and closures.


Chapter 11, Objects

Describes how objects are targeted and how their attributes (properties and elements) are referred to.


Chapter 12, References

Describes a device for encapsulation and delayed evaluation of expressions targeting objects and referring to their values.


Chapter 13, Datatypes

A guide to the built-in value classes (such as numbers, strings, lists, and records).


Chapter 14, Coercions

Explains how one datatype can be turned into another explicitly or implicitly.


Chapter 15, Operators

Catalogues the various ways to test and combine values, such as addition, comparison, and concatenation.


Chapter 16, Global Properties

Catalogues some predefined variables, such as (believe it or not) pi.


Chapter 17, Constants

Catalogues enumerations and classes that behave as reserved words.


Chapter 18, Commands

Catalogues the few built-in verbs not previously covered.


Chapter 19, Control

Surveys the linguistic structures for determining the flow of an AppleScript program, such as branching, looping, and error handling.

Part III, AppleScript in Action

Part III describes aspects of AppleScript in practice and in relation to the wider world.


Chapter 20, Dictionaries

Talks about the mechanism whereby applications make themselves scriptable through AppleScript by extending the AppleScript language, and explains how terminology is resolved and how to read and understand a dictionary.


Chapter 21, Scripting Additions

Explains the scripting addition mechanism; surveys the built-in scripting additions and provides some additional technical details.


Chapter 22, Speed

Collects some tips for optimizing the speed of AppleScript code.


Chapter 23, Scriptable Applications

Explains how to drive applications with AppleScript, on the same or a different computer, including certain kinds of web services. Also mentions some useful scriptable applications that come with Mac OS X.


Chapter 24, Unscriptable Applications

Talks about how AppleScript can be used together with the system's Accessibility API to automate the interface of applications that are not directly scriptable.


Chapter 25, Unix

Talks about how AppleScript can call the Unix shell command line and how Unix scripting languages can call AppleScript.


Chapter 26, Triggering Scripts Automatically

Describes ways that an application or process can find and call your script automatically, including folder actions, CGI, and attachability.


Chapter 27, Writing Applications

Discusses ways to turn an AppleScript program into a standalone application, ranging from a simple applet (written with AppleScript alone) to a full-fledged application with a true user interface or an Automator action (written with AppleScript Studio). Also introduces the techniques whereby a developer can add scriptability to an Objective-C Cocoa application.

Part IV, Appendixes


Appendix A, The AppleScript Experience

A brief hands-on tutorial or walkthrough, illustrating what it's like to plan and implement a task using AppleScript in real life.


Appendix B, Apple Events Without AppleScript

Lists some alternatives to AppleScript for creating and sending Apple events.


Appendix C, Tools and Resources

A list of references and further readings.


Previous Page
Next Page