Messages When the Finder Can not Find Your Application
Messages When the Finder Can not Find Your Application
When the user double-clicks a file or selects it and chooses either the Open or
the Print command from the Finder's File menu, the Finder looks for the
application whose signature is stored in the file's creator field. The Finder
starts up that application and tells it which documents the user wants to open
or print. If the Finder cannot find the creator application, it displays an alert
box.
If the document is of either file type 'TEXT' or 'PICT' and if the TeachText
application is available, an alert box asks the user whether the TeachText
application should be used to open the document. For documents of any other
file type, or if the TeachText application is not present, the Finder
displays an alert box like the one shown below:
The default application-unavailable alert box
Your application should store one of two string resources in its documents to
make the alert box message more useful than the default shown here.
Before displaying the default message shown in this figure, the Finder looks
in the document for one of two special 'STR ' resources: a message string or a
name string. If the Finder cannot find the document's creator on any mounted
volume, it looks first for the message string resource. Provide a message
string resource if you do not intend for users to open the file. The message
should explain why the file can not be opened. If the Finder does not find a
message string resource, it looks for the name string resource. Provide a name
string resource if you intend for users to open the file. The name string should
be your application's name; the Finder displays it in an alert box to inform
the user that your application is needed.
You supply either the message string resource or the name string resource;
do not supply both. Supply a message string resource for documents (such as a
p references file) that your application uses but that users should not open;
supply a name string resource for documents that you intend for users to open
with your application.
Your name string resource (an 'STR ' resource with a resource ID of
-16396) should contain the name of your application. For example, an
application named has a name string resource that looks like this:
resource 'STR ' (-16396, purgeable) { /* the application name */
"SurfWriter
};
Use the AddResource and WriteResource procedures to store this
resource in the documents created by your application. Then, if the user tries
to open or print one of your application's documents when your application is
not present, the Finder can specify your application's name in the alert box,
as illustrated:
The application-unavailable alert box specifying an application's name
Your message string resource (an 'STR ' resource with a resource ID of
-16397) should explain why the user cannot open or print a document. Use
this resource for files-such as your application's p references file-that are
not intended to be opened or printed by the user. Register a signature (as
explained in Creators, File types, and the Signature Resource) that
is different from the signature of your application, and set this signature as
the creator of files that you do not want your users to open. This ensures that
the Finder displays your message instead of launching your application when
the user double-clicks these documents.
The following resource illustrates a customized message explaining why the
user cannot open a p references file:
resource 'STR ' (-16397, purgeable) { /* the message */
"This document describes user p references for the application
"SurfWriter. You cannot open or print this document. To be effective,
"this document must be stored in the P references folder in the System
"Folder.
};
This shows the alert box generated by this resource.
The application-unavailable alert box with a customized message
Note that if your application creates documents of file types 'TEXT' or 'PICT',
if the TeachText application is available, and if your application is missing
when the user tries to open them from the Finder, the Finder always displays
the alert box shown next. For these file types, the Finder displays this alert
box even if you provide name or message string resources.
The application-unavailable alert box for 'TEXT' and 'PICT' documents