Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 7 - Finder Interface


Using the Finder Interface

The Finder needs quick access to some key information about your application, such as what icons to use when displaying your application and its documents. You supply most of this information in the resource fork of your application file.

The Finder extracts this information and uses it to maintain its own database of the resources it needs. The Finder records the location of your application on disk in
this database so that it can find your application quickly when the user opens one of your documents.

For compatibility with the Finder, your application should have

Note
Supply a missing-application name string resource for documents
that you intend for users to open with your application; supply an application-missing message string resource for documents (such
as preferences files) that your application uses but that users
shouldn't open. You supply only one of these resources in a document--never both.
Your application can also make use of these resources:

If you sell or distribute data in the form of a document to be used by other applications, you can assist users by providing

A catalog file exists on every volume to maintain relationships between the files and directories on that volume. (A volume is any storage medium formatted to contain files.) Although it's used mostly by the File Manager, the catalog file also contains information used by the Finder. You can always check the information in the catalog file. In particular, you may want to check the file type or creator for a file, or you may want to check or set one of the Finder flags for a document. When opening a document, your application should check a Finder flag to determine if the document is a stationery pad, and, if it is, your application should copy the document's contents into a new document and open the new document in an untitled window.

Your application might wish to use the folders located in the System Folder. Those you're most likely to want to access are Preferences, Temporary Items, and Trash. For example, you might wish to check for the existence of a user's configuration file in Preferences, create a temporary file in Temporary Items, or--if your application runs out of storage when trying to save a file--check how much storage is taken by items in the Trash directory and report this to the user. You can use the FindFolder function to get the path information you need to gain access to these system-related directories.

In System 7, users can create Finder objects called aliases to aid them in organizing their files. Ordinarily, when the user wants to open or print files, your application does not need to be concerned with whether they are aliases because the Finder resolves aliases before passing them to your application. However, if your application bypasses the Finder (or the Standard File Package, which is described in Inside Macintosh: Files) when manipulating documents, it should check for and resolve aliases itself by using the Alias Manager function ResolveAliasFile.

The rest of this chapter describes in detail how to use these Finder features in your application.


Subtopics
Giving a Signature to Your Application and a Creator and a File Type to Your Documents
Creating Icons for the Finder
Creating Customized Document Icons
Creating File Reference Resources
Creating a Bundle Resource
How and When the Finder Launches Your Application
Displaying Messages When the Finder Can't Find Your Application
Providing Version Resources
Using Finder Information in the Catalog File
Supporting Stationery Pads
Distributing Fonts, Sounds, and Other Movable Resources
Providing Balloon Help for Nondocument Icons
Using Aliases
Using the System Folder and Its Related Directories
The Desktop Database

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996