O'Reilly logo

AppleScript in a Nutshell by Bruce W. Perry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Finder Classes

Synopsis

In summary, getting to know Finder objects such as the application and item classes is a tremendous benefit to scripters. The following section describes the 36 classes that are part of the Finder dictionary in Mac OS 9. Remember that an object can have more than one of its elements, such as the Finder application’s container windows, but only one value for each of its properties. If you want to get a list of all of an object’s values for a certain element, enclose the element in plural form in a tell statement targeting the object, as in the following (which returns all open container windows in a list):

tell app "Finder" to container windows

It only sounds weird because I’ve left out the unnecessary get part of get container windows. Forthwith are all of our Finder classes.

Dictionary classes

alias file

This class represents an alias, which is a file that points to another file. For example, if you select a file called myfile and type Command-M, then this action creates an alias file in the same folder with the name “myfile alias” in italics. The following is an alias file property:

original item reference

This property returns the original item that the alias points to. For instance, if you make an alias file that opens Photoshop 5.5 when you double-click it, then this alias file’s original item property returns:

file "Adobe Photoshop 5.5" of folder "Adobe Photoshop 5.5" of¬ startup 
disk of application "Finder"
alias list

This is a class that represents ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required