beautypg.com

Properties and elements of the finder 2 – Apple AppleScript Finder Guide User Manual

Page 32

background image

C H A P T E R 2

Finder Objects

20

The Finder Application Object

Properties and Elements of the Finder

2

The Finder application, like most other Finder objects, has many properties you

can refer to in scripts. Some of these properties provide a shorthand method

of referring to certain specialized objects.
For example, although the Finder application can contain any number of

folders, only one Apple Menu Items folder can be located in the active System

Folder for a given Macintosh computer. The Apple Menu Items folder can be

described in a script as either an element of the System Folder or a property

of the Finder application.
This script identifies the Apple Menu Items folder as an object contained by the

System Folder:

tell application "Finder"

open folder "Apple Menu Items" of ¬

folder "System Folder" of startup disk

end tell

This script identifies the Apple Menu Items folder as a property of the Finder

application:

tell application "Finder"

open apple menu items folder

end tell

Other specialized containers, such as the startup disk, the System Folder,

the Startup Items folder, and the Extensions folder, are also defined as

Finder properties.

Note

You can use the Path To scripting addition command

to obtain references to some of the objects that can be

identified as properties of the Finder. However, Path To

use its own constants for these references and returns a

pathname as an AppleScript reference of the form alias
"

Disk:Folder1:Folder2:...:Filename"

.

The desktop is another container you can identify as a property of the Finder.

Any items contained by the desktop—that is, items that are “loose” on the