The Resedit Chapter

The Resedit Chapter

Chapter 21 The ResEdit Chapter IN THIS CHAPTER: I What ResEdit is I Fundamentals of using ResEdit I Customizing menus, buttons, and dialog boxes I Secret messages in your system software I Ten great ResEdit pranks This book could not live up to its name without a chapter on ResEdit. ResEdit isn’t just another application; it’s the key that unlocks some of the Mac’s strangest and most elusive secrets. And we’re talking real secrets here — not just undocumented features, obscure Ô-key combinations, or cute hidden messages. We’re talking about the nuts-and-bolts stuff of which programs are made, stuff that’s completely invisible to the average user. ResEdit lets you poke into any application’s resources, its most basic com- ponents, and rebuild them the way you want. If you don’t like the name of a menu command, you can change it. If you’re running short on hard drive space, you can rip unneeded sounds and pictures right out of your applica- tions. You can totally redesign menus, dialog boxes, icons — all without knowing the first thing about programming. Veteran Mac Secrets owners are no doubt rifling through their CDs, exclaiming,“Hey — where the heck’s ResEdit?” It’s true: for the first time, this edition of Mac SECRETS doesn’t come with ResEdit. Apple increased the 683 684 Part III: Application Secrets amount it charges us to license ResEdit tenfold — a weird and goofy move, we think, since ResEdit is available for free from about 11,000 sources. For example, it’s on America Online (use the Search Software Libraries command in the Go To menu). It’s also available from Apple’s Internet software site, ftp://ftp.support.apple.com/apple_sw_updates/US/Macintosh/Utilities; our own Web site, http://www.idgbooks.com/idgbooksonline/macsecrets, has a link to Apple’s ResEdit download page. And if you have no modem, a local Mac user group can provide ResEdit; as a last resort, you could call IDG Books at 800-434-3422 and request the floppy-disk set from the third edition of this book. WHAT IS RESEDIT? Every recognizable Mac element of a program — icons, menus, dialog boxes, cursors, background patterns, sounds, graphics — are called resources. ResEdit stands for resource editor, and that’s just what it is: Apple’s own utility for changing a file’s resources. Apple created ResEdit early in the Mac’s his- tory so that programmers could easily manipulate the basic elements of the Macintosh interface. Over the years, successive versions of ResEdit have become safer and more user-friendly. Today, it’s accessible enough even for an advanced beginner to use. ResEdit lets you edit many different kinds of resources. System 7.5.5’s System file alone contains 178 different types. Some are easier to edit than others. To work with icons, for example, ResEdit provides basic painting tools. For windows and dialog boxes, there are tools for changing the color, size, and arrangement of the window elements; these tools closely resemble those you might find in a drawing program. Other types of resources aren’t quite so easy to handle. If you try to edit a resource for which ResEdit has no special Figure 21-1 editing tools, the program opens the resource in a hex edi- The unfriendly looking hex editor displays a resource’s code in hexadecimal form. tor. A hex editor is a window that displays the resource’s code in raw hexadecimal form. The first time you open a hex editor (see Figure 21-1), you may momentarily think you’re working with some- thing very foreign and incomprehensible — like DOS. Nonetheless, you can edit a resource using a hex editor; you just have to know which part of the code to change. Several of the Secrets described in this section require you to work with a hex editor. But don’t worry, we’ll tell you precisely which part of the code to select and how to change it. All in all, it’s pretty painless. Chapter 21: The ResEdit Chapter 685 HOW TO USE RESEDIT ANSWER MAN A hex on both your houses Editing a resource is simple: Drop the icon of the Q: Not so fast there, Answer Men.You’re not file you want to examine or edit onto the ResEdit going to lob a term like hexadecimal at us icon. (Actually, drop a copy of that file, for safety; without defining it, are you? more on this topic later.) A: No. Alternatively, or in System 6, launch ResEdit. An Open File dialog box presents itself; open the file Because it’s a binary machine, the Mac has 16 you want to change. “fingers” to count on instead of 10, like You can open any kind of file: applications, con- humans.Therefore, it has to count beyond 15 before advancing into two-digit numbers. trol panels, system extensions, or any other file. (Most documents don’t have resources, however.) As a consequence, we humans have invented Doing so reveals a window filled with icons repre- a bizarre numbering system called senting all the different types of resources used in the hexadecimal, in which you can count all the way up to 15 with a single digit.You count in file, as shown in Figure 21-2. hex like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.The next number, in our notation, would be Figure 21-2 16. In hex, the next number is written 10! SimpleText,as seen through the eyes of ResEdit.Each resource type is represented by an icon. Here are some basic equations in hexadecimal notation: 2 + 2 = 4. Next, we have 4 + 4 = 8. But 8 + 7 = F.And F + 1, as we’ve said, is 10 (in hex). Get it? (We admit that this sort of plays with your head.) As you can see, each resource type is identified not only by an icon, but by a four-character code, such as FOND, DLOG, or STR#. (Some resource names like “snd” or “STR” appear to be only three characters long, but they actually consist of three characters and one space.) Often these codes hint at their contents. The ICON resource is where you can change the shape of your icons (the real icons, not the kind you can paste into the Get Info box in System 7); the DLOG is how you change a dialog box; and CURS is where the cursor shape lives. 686 Part III: Application Secrets ANSWER MAN Look for the type of resource you want to edit. Then It don’t work! open its icon by double-clicking. This introduces a new Q: I tried one of your ResEdit hacks, window listing all the individual resources of that particu- and it didn’t work! lar type (for example, all the sounds in a program). Each A: Hey.We tried.We tested every resource is tagged with an ID number. Double-click the trick on almost every System version resource you want to modify and the appropriate editing we could find, but there are some window will open. (We’ll walk you through all this, step by incarnations of the Mac’s System step, in the following Secrets.) software we simply couldn’t get our Occasionally, when you try to open resources in the hands on.We are sorry if something System file, you’ll encounter a dialog box warning you that doesn’t work on your system, or with the resource is compressed and asking if you want to edit it your particular set of extensions. But frankly, this is hacking; you do your anyway. Click Yes and the resource will automatically be deed and then see if it flies. decompressed. That’s really all you need to know to pull off any of the If you operate only on a backup of tricks listed in this section. But before you go hacking away the target file, you’ve lost nothing by trying. at your System file, we need to discuss the Peril Factor. The Peril Factor Articles and books on ResEdit are generally introduced with a morose warn- ing about how perilous this program can be. We’ve heard people describe ResEdit as if it were some kind of poisonous snake, difficult to handle and potentially hazardous. Actually, ResEdit is neither intimidating nor dangerous. In fact, we’re con- fident that using it will never result in any kind of fatal computing disaster if you follow these sensible guidelines: I Make sure you have a backup, somewhere, of whichever file you try to edit with ResEdit. (You can’t edit the active Finder — only a copy of it.) The procedures here are all tried and tested. But if, through some slip-up, you end up with a System file that behaves oddly, the backups make it easy to recover. I To make a quick backup of your System file, Option-drag it out of your System Folder — to, say, the Desktop. Make your ResEdit changes to this copy. After saving your changes to the copy, put your original, untouched System file (until now, still in the System Folder) into a safety folder of its own. Finally, put the edited copy — sitting out on the Desktop — into the System Folder. You’ve just swapped them. Now restart the Mac. (Keep your still-virginal copy around for handy replacing access.) Chapter 21: The ResEdit Chapter 687 I Nothing you do in ResEdit “takes” until you save your changes using the Save command.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    41 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us