Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix A - The Language at a Glance


Commands

A command is a request for action. In AppleScript, you can use application commands, which are defined in each application's dictionary; AppleScript commands, which are defined and handled by AppleScript;
or scripting addition commands, which are defined and handled by AppleScript extensions called scripting additions.

Table A-1 lists standard application commands and AppleScript commands. (For information about scripting addition commands, see the AppleScript Scripting Additions Guide.) The syntax shown for standard application commands is the syntax supported by most applications. Individual applications can extend or change the way the standard application commands work.

For information about how a specific application handles a particular application command, see the application's dictionary. For more detailed descriptions of the commands listed here, see Chapter 4, "Commands."

Command syntax
CommandSyntaxResult
close
(application command)
close referenceToObjectNone
close referenceToObject saving in referenceToFile
close referenceToObject saving saveOption
close referenceToObject saving in referenceToFile ÿ
saving saveOption
copy
(AppleScript command)
( copy | put ) expression ( to | into) variablePatternValue copied
copy
(application command)
( copy | put ) expression
( to | into) referencePattern
Value copied (none if no parameters are included)
( copy | put )
( copy | put ) referenceToObject
count
(AppleScript command)
count compoundValue

count [ each | every ] className ( in | of ) �
compoundValue

Integer
number of compoundValue

number of pluralClassName ( in | of ) compoundValue

count
(application command)
count [ each | every ] className

count [ each | every ] className
( in | of ) referenceToObject ]

Integer or
list of integers
number of className

number of className [ ( in | of ) referenceToObject ]

 
data size
(application command)
data size of referenceToObjectInteger or
list of integers
data size of referenceToObject as className
delete
(application command)
delete referenceToObjectNone
duplicate
(application command)
duplicate referenceToObjectReference
duplicate referenceToObject to referenceToLocation
error
(AppleScript command)
error �
[ errorMessage ] �
[ number errorNumber ] �
[ from offendingObject ] �
[ partial result resultList ] �
[ to expectedType ]
 
exists
(application command)
exists referenceToObjectBoolean
referenceToObject exists
get
(AppleScript command)
get expression

get expression as className

Value of expression
get
(application command)
get referenceToObject

get referenceToObject as className

Value of reference
 
launch
(application command)
launch

launch referenceToApplication

None
make
(application command)
make [new] className at referenceToLocationReference to the new object
make [new] className at referenceToLocation ÿ
with properties { propertyLabel:propertyValue ÿ
[, propertyLabel:propertyValue ]...}
make [new] className at referenceToLocation ÿ
with data dataValue
make [new] className at referenceToLocation ÿ
with properties {propertyLabel:propertyValue ÿ
[, propertyLabel:propertyValue ]...} ÿ
with data dataValue
move
(application command)
move referenceToObject to referenceToLocationReference to the moved object
open
(application command)
open referenceToFileNone
open listOfFiles 
print
(application command)
print referenceToObjectNone
 
quit
(application command)
quit referenceToApplicationNone
quit referenceToApplication saving saveOption
run
(AppleScript command)
run

run scriptObjectVariable

The value, if any, returned by the script object
run
(application command)
run

run referenceToApplication

None
save
(application command)
save referenceToObjectNone
save referenceToObject in referenceToFile
set
(AppleScript command)
set variablePattern to expression

expression returning variablePattern

Value assigned
set
(application command)
set referencePattern to expression

expression returning referencePattern

Value assigned


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996