beautypg.com

References to finder windows 2 – Apple AppleScript Finder Guide User Manual

Page 34

background image

C H A P T E R 2

Finder Objects

22

The Finder Application Object

window of startup disk of application "Finder", content
space of desktop of application "Finder", desktop of
application "Finder", application "Scriptable Text Editor",
application "Script Editor"}

For complete lists of the Finder application object’s properties and element

classes, see the definition for the Application object class, which begins on

page 31.

References to Finder Windows

2

One of the Finder elements you can refer to in scripts is a content space, which

can be any kind of window or the desktop. If you request all the content

spaces, the Finder returns a list of references to all kinds of windows (container

windows, information windows, sharing windows, and status windows)

and the desktop:

tell application "Finder"

content spaces

end tell

--result: {information window of startup disk of
application "Finder", window of folder "Projects" of
startup disk of application "Finder", window of startup
disk of application "Finder", window of disk "Applications"
of application "Finder", content space of desktop of
application "Finder"}

The result shown in the preceding example includes one information window,

three container windows, and the desktop content space. An information

window is the window that opens when you select an object’s icon in the

Finder and choose Get Info from the File command. Containers are objects that

can hold other objects, such as suitcases, folders, disks, and the desktop, and a

container window is a window that belongs to a container. The only exception

is the desktop window. Even though the desktop is a container, the desktop