
|
|
ResEdit and Templates by Marlon Deason
It's all ones and zeros. I'm sure you have heard this used to describe the inner workings of a computer. But why don't we Macintosh users see them? How does ResEdit let you poke around in the guts of your Mac and still present a graphical interface? The answer is a resource of course!
The templates in ResEdit
|
The TMPL resource is found in ResEdit and other applications. This resource is a 'template' for other types of resources. Any resource that has a graphical representation in ResEdit has a correspondingly named resource listed under the TMPL.
But how can I view my TMPL resources? If I open ResEdit in ResEdit won't I create a rip the space time continuum? It is very dangerous to open ResEdit while it is already open in the Finder, so only open a copy of ResEdit to look at the TMPL resources. But what happens if I don't have a TMPL for a particular resource? ResEdit has a catch-all editor called the Hex Editor.
A resource opened with the HEX Editor
|
If you have ever clicked on a resource that looks like a bunch of 1's and 0's you have used the Hex Editor.
Didn't you say that other applications haveTMPL resources too? Yes, when programmers create new resource types for use in their applications, they often create TMPL resources for them. If you are lucky, they will leave the TMPL resource in the application so you can use it too.
So what's the big deal? I have TMPL resources in ResEdit and in some applications, what good do they do me? Well, the more TMPL resources you have, the less 1's and 0's you have to look at, and the more of your system and applications you can tweak. TMPL's are also available on the internet from third-party developers. TMPL resources are like trading cards you collect them and as soon as you hear of one you don't have, you get it.
What is the best way to collect and store TMPL resources? The best way to store TMPL resources is to paste them into the preference file of ResEdit. I have to thank the editors of 'Zen and the Art of Resource Editing' from BMUG for this unique solution. A preference file is only used while a program is loading and not while the program is running. So it is ok to edit the ResEdit preference file while ResEdit is running. Pasting all your TMPL's into the ResEdit prefs file also eliminates the possiblity of a resource ID conflict, where two resources have the same number. If you reinstall or upgrade your copy of ResEdit, you will still have your TMPL's in the prefs.
Assign TMPL's to any Resource
|
What do you do when you have a resource you want to edit, but you don't have a TMPL. Do you really have to use the Hex Editor? Actually there is a really sneaky way you can use another resource's TMPL by changing the RMAP resource in ResEdit. See if you can figure it out. If not stay tuned for an upcoming story about the RMAP resource.
|
|