DekGenius.com
Team LiB   Previous Section   Next Section

Chapter 14. Mac OS 9 Finder Commands

If automation honchos want to do anything with their computer, it's command and control the operating system itself. You want to be able to back up, create, delete, or otherwise manage files, but only of certain types or modification dates, for example. A programmer wants a script to be able to return information about all of the volumes on the desktop, including the bytes of free or occupied space and the contents of these disks. A scripter desires to find out about a machine's largest free block of memory space, then shut the machine down or put it to sleep. These tasks and much more can be accomplished by scripting the Finder. This is the venerable Mac application that handles the graphical interface between the user and the machine's operating and file systems. Finder objects like icons, folders, windows, and menus are what you see on your computer screen. The much hallowed Finder is the alternative to working solely within a featureless window typing phrases on a single command line. The Finder provides the visual nature of the Macintosh that has largely made this computer brand famous.

The Finder has a very large dictionary (as indicated by this chapter's extensive reference!), which exposes objects like folders, files, disks, and the Finder application itself for scripters to do (almost) whatever they want with. Figure 14-1 shows the Finder's application icon, which in Mac OS 9 is located in startup disk:System Folder.

Figure 14-1. The Finder icon
figs/ascr_1401.gif

You can open the Finder's dictionary by choosing File Open Dictionary... from the Script Editor's menu, then choosing the Finder in the resulting dialog window. Figure 14-2 shows the Finder's dictionary window. Chapter 2, describes the Script Editor and dictionaries.

Figure 14-2. Finder dictionary window
figs/ascr_1402.gif
    Team LiB   Previous Section   Next Section