Chapter 2 - Overview of AppleScript
AppleScript is a dynamic, object-oriented script language. At its heart is the ability to send commands to objects in many different applications. These objects, which are familiar items such as words or paragraphs in a text-editing application or shapes in a drawing application, respond to commands by performing actions. AppleScript determines dynamically--that is, whenever necessary--which objects and commands an application recognizes based on information it obtains from each scriptable application.In addition to manipulating objects in other applications, AppleScript can store and manipulate its own data, called values. Values are simple data structures, such as character strings and real numbers, that can be represented in scripts and manipulated with operators. Values can be obtained from applications or created in scripts.
The building blocks of scripts are statements. When you write a script, you compose statements that describe the actions you want to perform. AppleScript includes several kinds of statements that allow you to control when and how statements are executed. These include If statements for conditional execution, Repeat statements for statements that are repeated, and handler definitions for creating user-defined commands.
This chapter provides an overview of AppleScript. It includes a summary of how AppleScript works and brief descriptions of the AppleScript language elements. Part 2 of this book, "AppleScript Language Reference," describes the elements of the AppleScript language in more detail.
Chapter Contents
- How Does AppleScript Work?
- Statements
- Commands and Objects
- Dictionaries
- Values
- Expressions
- Operations
- Variables
- Script Objects
- Scripting Additions
- Dialects
- Other Features and Language Elements
- Continuation Characters
- Comments
- Identifiers
- Case Sensitivity
- Abbreviations
- Compiling Scripts With the Script Editor