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

Chapter 15. Mac OS 9 Finder Classes

The best way to script the Finder under Mac OS 9 is to get up close and personal with its object model. What is an object model? An object model is an abstract depiction of a software program (such as the Finder). This model, similar to an architectural model of a house or landscape design, conveys the program’s behavior or what it is designed to do in the form of functions and commands, for example:

shut down

or:

get size of folder "giantFolder"

The object model also depicts the software units that comprise the software, along with the elements or properties that distinguish the Finder from other Mac software programs. The values of elements and properties differentiate one version of the Finder from another. You might recall from the brief Chapter 1, object discussion that an object has exactly one of its properties (e.g., the Finder has one name property and that is, as you might have guessed, “Finder”). A person object might have an age property. They can only have one age value at any given time, except for those of us in our forties who are fond of trying to recapture our twenties (we can have two ages at any given time, chronological and imagined). On the other hand, an object can have zero or more elements. For instance, the Finder has an item element, because the Finder usually works with numerous items during its computing session, such as disks, folders, and files. Figure 15-1 shows the Finder’s object model, including its elements ...

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