Advocacy

  Myths
  Press

Dojo (HowTo)

  General
  Hack
  Hardware
  Interface
  Software

Reference

  Standards
  People
  Forensics

Markets

  Web

Museum

  CodeNames
  Easter Eggs
  History
  Innovation
  Sightings

News

  Opinion

Other

  Martial Arts
  ITIL
  Thought


What is a Resource?
Beyond the article in MacAddict Magazine

By:David K. Every
©Copyright 1999


Programmers write reams of obscure instructions to tell the computer, in excruciating detail, exactly what it should do.

Sometimes programmers tell the computer to draw a picture, show a menu, display a cursor, or put up a window. These elements used to be buried deep inside the secret and obscure language that only a programmer could known and love -- and only a programmer could change. This was annoying since most programmers (myself included) spell like 3rd grade dyslexics, and programs need to be altered by people other than programmers (like those who can spell). So the great designers at Apple changed the paradigm, they split Applications into two halves. Normally there is the "data fork", where all the programming information (data) resides. But Apple added a "resource fork", where all these common resources (Pictures, Windows, Menu's) would reside, so that we can change these things without being programmers. Then Apple and Mathemaesthetics created special resource editors to make it easy to fix or tweak these resources.

Resource made life much easier for companies developing software. Because of Apple, companies can change things for international markets or fix programmers many spelling mistakes -- as a bonus, it made it much easier for us to go in and "improve" (see "hack") the Mac. So with an iron will, unmitigated gall and complete lack of fear (and reason), we can dive in and tweak perfectly working programs and make them display what WE want them to -- which is not usually what the programmers intended. (1)

(1) While Microsoft ripped off most of their best ideas from the Mac, they missed many of them -- like this one. And, it is still far more painful to fix (and hack) Windows "resources" for just this reason. Repeat after me, "The Mac is Cool!"

The Basics of Resource Types

There are many "types" of resources. Back in 1984, the Mac had 128K or RAM and memory was expensive, so Apple used special abbreviations to differentiate "types" of resources. They decided 4 characters (case sensitive) would give them plenty of choices (something like 16 Million different combinations) -- and a few of those abbreviations are even understandable. Once you understand the basics of what these resource abbreviations mean, you can modify all sorts of things.

Here are some cues to figure out what a resource is, just from the type

  1. Some Resources are lower case, and some are upper case. When the Mac was first created (1982-1984) the resource types tended to be all upper-case. Later, as Apple added color to the Mac, and started adding new resources, they tended to do that with lower case "types". So the lower case types are usually newer.
     
  2. Some of the resources have a '#' character. What that means is that the resource is an "array" or list of items. So an STR is a single string, but each STR# is actually a whole list of strings, grouped in some way that is sensible only to programers I'm sure.
     
  3. The suffix "DEF" is for Definition. This is a way that Mac Programmers could write a small code snippet to extend the "definition" of how something worked. This little bit of code could make whatever they modified more powerful and extensible over time. So a WDEF is a new Window Definition. This was all really powerful stuff in 1984, and is the forerunner to Object Oriented Code.

 

Types

Description

AIFF
acur
aete
alis
ALRT
BNDL
CDEF
cicn
clut
CNTL
CLUT
code
crsr
CURS
dftb
DITL
DLOG
FKEY
FONT
FOND
FREF
hfdr
hmnu
icl4
icl8
icm#
icm4
icm8
ICN#
ics#
ics4
ics8
INIT
KCHR
LDEF
MDEF
MENU
PACK
PAT
PAT#
PICT
ppat
SICN
sicn
SIZE
snd
snth
STR
STR#
styl
TEXT
TMPL
Txtr
vers
WIND
WDEF
xmnu

Audio Interchange Format (Amiga Sound)
animated cursor
AppleScript terminology
alias information
alert (warning dialog)
file bundle
Control Definition (for extending controls)
color icon
color look-up table
Control
Color LookUp Table (set of colors or palette)
programming code
color cursor
cursor (black-and-white)
dialog font table
dialog item list (list of controls in a dialog or alert)
dialog
function keys
A font (set of characters)
A font definition (this definition is family grouping not code)
file reference
balloon help for the Finder file
Help menu (balloons)
four-layer (16-color) large icon (32 by 32)
eight-layer (256-color) large icon (32 by 32)
mini-icon list (family)
four-layer (16-color) mini-icon (12 by 16)
eight-layer (256-color) mini-icon (12 by 16)
icon list (family)
small-icon list (family)
four-layer (16-color) small-icon (16 by 16)
eight-layer (256-color) small-icon (16 by 16)
initialization code (stuff run at OS startup)
Keyboard Characters (maps which character goes with which key)
List Definition (to change how lists work)
Menu Definition (for extending Menus)
menu (that one is tough)
Package code for things like the Open, Save, and Print Dialogs
pattern (black-and-white)
pattern list
pictures
pattern (color)
small icon(s)
small icon (16 by 16, black-and-white)
application memory size
digitized sound
synthesized sound
string
string list
text type styles and colors
plain text
template (to view resources as data structures)
text traits
version (tells the Finder what version this is)
window (where a Window is positioned, its size, and so on)
Window Definition (to change how Windows work)
extended appearance

Conclusion

That is a pretty comprehensive list of the basic types. You probably won't need to hack a few of those, nor most of the types not mentioned. By now you have a pretty good idea about resources -- what they are, and how they are used. Explore, learn and have fun -- this stuff isn't too hard.


Created: JULY/98
Updated: 11/09/02


Top of page

Top of Section

Home