Language Guide
Types of Commands 71
CHAPTER 4
Commands 4
Figure 4-0
Listing 4-0
Table 4-0
A command is a word or series of words used in AppleScript statements to
request an action. Every command is directed at a target, which is the object
that responds to the command. The target is usually an application object,
but it can also be a script object or a user-defined subroutine or value in the
current script.
Not all commands can be used with all types of targets. When you use a
command to request an action, you must choose a command that works with
the target you want to manipulate. You must also be sure to specify the target
correctly. Several factors, including the direct parameter you provide with a
command and whether or not the command is included in a Tell statement, can
determine the target of a command.
This chapter begins by describing types of commands and targets of commands.
It summarizes which types of commands work with which types of targets.
Next, it describes the details of using commands and command definitions,
including specifying parameters and using results of commands. The chapter
ends with definitions of standard commands.
Types of Commands 4
You can use four types of commands in AppleScript to request actions:
application commands, AppleScript commands, scripting additions, and
user-defined commands.
Each time you use a command, you specify the target, or recipient, of the
command. Potential targets include application objects, script objects, the
current script, and the current application. In some cases you specify the
target explicitly by including it in a Tell statement or supplying a direct
parameter. In other cases you specify the target implicitly.