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: Apple Guide Complete / Part 4 - Scripting Guide Files
Chapter 10 - Guide Script Command Reference / Guide Script Command Descriptions
/ Importing Resources


<Resource>

You can use the <Resource> command to specify a file containing one or more resources to be included in your guide file. Use this command to include all resources in a file, all resources of a given resource type, all resources with a given resource ID or resource name, or a single resource.

<Resource> fileName, resType [, whichResource]
fileName
A filename of the file containing the resource to import. This file must be located in the same folder as your source files when you compile your guide file. A guide file and any resources used by the guide file must reside in the same folder.
resType
A four-character value specifying the resource type or the constant ALL. Use the constant ALL to include all resources in the file in your guide file. Specify a specific resource type to include only resources of that type.
whichResource
A resource ID or resource name of a resource. The resource included depends on the value that you specify in the resType parameter. To include a single resource, specify the resource's resource type in the resType parameter and the resource ID or resource name of the specific resource in the whichResource parameter. If you specify the resource's resource type in the resType parameter and omit the whichResource parameter, all resources of that type are included. This parameter is optional.
DESCRIPTION
When Guide Maker encounters a <Resource> command, it opens the file referenced by the fileName parameter and reads in the resources described by the resType and whichResource parameters. These resources are then compiled into the guide file and are available for use by other Guide Script commands, such as the <PICT> and <QuickTime> commands.

The file Standard Resources is provided with Guide Maker. This file contains 'PICT' resources that define the Continue, Huh?, and GoStart buttons and provides templates (the 'PICT' resources with IDs 501 and 502) that you can use to create your application logo picture. It also contains 'extm' resources; these are external modules (the Standard Setup file contains corresponding <Define Context Check> commands for each external module). External modules referenced through a <Define Context Check> command can be used to specify a condition in <Make Sure> and other commands.

SPECIAL CONSIDERATIONS
For the resources that you plan to use in your guide file, you should assign each resource a resource ID between 2000 and 20,000. Apple Guide reserves the use of resource IDs less than 2000.

If you specify a <Resource> command, it must appear outside of any sequence or panel definitions.

For 'PICT' resources, you can provide a color version and a black-and-white version. You should assign the black-and-white 'PICT' a resource ID that is one greater than the resource ID of its corresponding color graphic.

EXAMPLES
#read in all resources of type 'PICT' in the file "All My Picts"
<Resource> "All My Picts", 'PICT'

#read in the 'PICT' resource with resource ID 2218
<Resource> "My Picture", 'PICT', 2218

#read in all resources from the file "Lots of Resources"
<Resource> "Lots of Resources", ALL

#read in the 'PICT' resource with resource ID 2228 
# from the file "My Pict for Movie"
<Resource> "My Pict for Movie", 'PICT', 2228
#this 'PICT' resource is now available for use
<Define Panel> "Example Panel With Movie 3"
   #place a QuickTime movie on the panel and specify
   # replacement picture as 'PICT' resource with res ID 2228
   <QuickTime> "My QT Movie", CENTER, PLAIN, 2228
<End Panel>
#read in resources from the file "Standard Resources"
<Resource> "Standard Resources", ALL
SEE ALSO
For information on the <PICT> command, see page 10-95. For information on the <QuickTime> command, see page 10-98.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
12 JUL 1996