beautypg.com

Apple AppleScript Finder Guide User Manual

Page 36

background image

C H A P T E R 2

Finder Objects

24

The Finder Application Object

You can refer to windows by name, by number, or as the window property of

the object to which they belong. For example, these statements are equivalent:

window "My Folder"
window of folder "My Folder" of startup disk

These statements are also equivalent:

window 1
front window

The Finder’s front window isn’t necessarily the active content space, which can

be the desktop as well as a window. To get a reference to the active content

space, use this statement:

content space 1

References Returned for the Insertion Location property

2

The Finder’s Insertion Location property returns a reference to the object to

which new information can currently be added. For example, if the New Folder

command in the File menu is active, the insertion location is a reference to the

container in whose content space the new untitled folder appears when you

choose New Folder. This container can be a folder, a disk, or the desktop:

tell application "Finder"

insertion location

end tell

--result: desktop of application "Finder"

If the active content space is a sharing window or an information window, the

insertion location is a reference to the container to which the window belongs.