beautypg.com

The finder application object 0 – Apple AppleScript Finder Guide User Manual

Page 30

background image

C H A P T E R 2

Finder Objects

18

The Finder Application Object

The Finder Application Object

0

The Finder application object belongs to the object class Application. As is

usually the case with scriptable applications, the application object functions

as the outermost container for most of the objects the Finder defines.
To send commands to the Finder, use a Tell statement addressed to the Finder:

tell application "Finder"

open startup disk

end tell

––result: startup disk of application "Finder"

The result shown appears in the Script Editor’s Result window. The statement

startup disk of application "Finder"

is a complete reference to the startup disk. The Finder application itself is the

startup disk’s container. Disks, folders, and files are examples of objects that

can be elements of the Finder application. Folders and files can in turn be

elements of disks or of folders within disks.
You can identify nested Finder objects in a variety of ways. For example, if the

startup disk is named My World, these statements all identify the same object:

folder "My Folder" of startup disk of application "Finder"
folder "My Folder" of disk "My World" of application "Finder"
item "My Folder" of container "My World" of application "Finder"
container "My World:My Folder" of application "Finder"

When recording is turned on, the Finder always records references the same

way. Although the Finder can interpret the four statements in the previous

example correctly, it records the reference as shown in the first statement.