Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 4 - Commands


Command Definitions

The sections that follow are in alphabetical order by command name and provide definitions for both AppleScript commands and standard application commands. The general features of these types of commands are described in "Types of Commands,"which begins on page 71. The command type is listed opposite the command name on the first line of each definition.

For definitions of commands provided by the scripting additions that come with AppleScript English, see the AppleScript Scripting Additions Guide. For definitions of commands provided by other scripting additions, see the documentation for those scripting additions.

The application commands defined in this chapter are standard application commands supported by most applications. The definitions in this chapter describe how these commands work in most applications. Individual applications can extend or change the way the standard application commands work.

Application dictionaries list application commands under two categories, the Required suite and the Standard suite. All applications support the commands in the Required suite. Different applications may support different commands in the Standard suite. Table 4-1 summarizes the standard application commands described in this chapter that belong to each suite.

Many applications also define their own suite of more specialized commands. The application's dictionary provides definitions of all commands supported by the application. Check the appropriate application dictionary before using application commands. You can open an application's dictionary by selecting the application's icon on the desktop, dragging it over the Script Editor's icon, and releasing the mouse button.
Standard application commands defined in this chapter
CommandSummary
Required suite
OpenOpens a file.
PrintPrints one or more objects.
QuitTerminates an application.
RunLaunches an application and invokes its standard startup procedures.
Standard suite
CloseCloses one or more objects.
CopyCopies an object or objects to the Clipboard or to a
new location.
CountCounts elements of a particular class in an object.
Data SizeReturns the size, in bytes, of the value of an object.
DeleteDeletes one or more objects.
 
DuplicateCopies an object or objects to a new location.
ExistsDetermines if an object exists.
GetReturns the value of an object.
Launch[1]Launches an application without invoking its standard
startup procedures.
MakeCreates a new object.
MoveMoves an object or objects.
SaveSaves an object to a file.
SetAssigns a value to an object.

Table 4-2 lists the AppleScript commands defined in this chapter.
AppleScript commands defined in this chapter
CommandSummary
CopyAssigns a value to a variable.
CountCounts the elements of a compound value.
GetReturns the value of an expression.
RunExecutes statements other than handler and property definitions in a script object definition.
SetAssigns a value to a variable.

Another AppleScript command, the Error command, is described in "Try Statements," which begins on page 204.


[1] Although the target of a Launch command is always an application, it is actually handled by AppleScript. Unlike the other commands listed in this table, the Launch command doesn't need to be explicitly supported by applications and doesn't appear in any application's dictionary.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996