Commands handled 2, Default value class returned 2, Examples 2 – Apple AppleScript Finder Guide User Manual
Page 29
C H A P T E R 2
Finder Objects
Using Object Class Definitions
17
Commands Handled
2
Objects that belong to the same class can respond to the same commands.
Object class definitions list the commands to which all objects of that
class respond.
For example, the definition for File that begins on page 61 indicates that you
can use any of these commands to perform actions on a file: Clean Up, Copy,
Count, Data Size, Delete, Duplicate, Exists, Get, Make, Move, Open, Print,
Put Away, Reveal, Select, Sort, Update.
Default Value Class Returned
2
In most scriptable applications, each object has a value that you can obtain
simply by referring to the object in a script. For example, the value of a
paragraph object in a word-processing application is a string that includes
style and font information.
Unlike other scriptable applications, the Finder can control only the representa-
tion of its objects within windows and the properties it defines for them; it can’t
retrieve or alter text in a text file, for example. Therefore, the value returned for
most Finder objects is a reference to the object, not the object’s data.
For example, this script returns a reference to the file MyFile, not the contents
of the file:
tell application "Finder"
get file "MyFile" of startup disk
end tell
--result: file "MyFile" of startup disk of application "Finder"
Examples
2
Each object class definition in this book include one or more short examples
demonstrating how to use the object name in a script. The first example for the
File command definition that begins on page 61 is a script that returns a list of
references to files whose modification dates are greater than a specified date,
and the second example is a script that copies an icon to a group of files.