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: More Macintosh Toolbox /
Chapter 1 - Resource Manager / Resource Manager Reference
Resources in the System File


User Information Resources

The following resources in the resource fork of the System file provide the user's name, the computer name, the model of computer, the icon for the computer model, and the current printer type:
InformationResource IDResource
type
Description
User name-16096'STR 'The name of the person who "owns" the computer or is the current user. Use the GetString function with this resource ID to return the user name.
Computer
name
-16413'STR 'The name of the computer, which is distinct from the user name and from any internal hard disks that may be present. The default name of the computer is "User name's Macintosh." Use the GetString function with this resource ID to return the computer name.
Computer model-16395'STR#'The model of the computer, such as Macintosh SE/30 or Macintosh IIci. The Gestalt selector for the computer model is gestaltMachineModel, and the Gestalt function returns a response value for this selector. You can use
this value as an index into the 'STR#' resource using the GetIndString procedure. You should never use the model of the computer as an indication of what software features or hardware may be available.
Computer
icon
Value of responseparameter returned from Gestalt 'ICN#'
'icl4'
'icl8'
'ics#'
'ics4'
'ics8'
The icon for the computer model, such as the Macintosh II or Macintosh IIci. The icons for computers are stored in icon families. The Gestalt selector for the computer icon is gestaltMachineIcon. Use the value from the response value for this selector as the resource ID of the icon resource you want. (For more information about icon families, see the chapter "Finder Interface" in Inside Macintosh: Macintosh Toolbox Essentials.)
Printer type-8192'STR 'The type of printer to which the computer sends documents, such as a LaserWriter printer. There is no method for retrieving the name of the printer. Use the GetString function to return the type of printer.

You should use GetString, not GetResource, to get the string for the user name or the computer name. Once you have the string, you should not release it, dispose of it, or make it purgeable. You will find that the resource was already loaded when you asked for it, so it should remain loaded when you are finished. Do not change the contents of either of these strings or mark them as changed. System 6 and earlier versions of system software do not necessarily have the computer name resource, and for this reason you should provide error checking as appropriate.

The GetString function, GetIndString procedure, and Gestalt function are documented in Inside Macintosh: Operating System Utilities.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996