Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site utah-gr.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!teddy!panda!talcott!harvard!seismo!utah-cs!utah-gr!thomas From: thomas@utah-gr.UUCP (Spencer W. Thomas) Newsgroups: net.micro.mac Subject: Re: RMover and ResEdit answers and question Message-ID: <1291@utah-gr.UUCP> Date: Mon, 7-Jan-85 16:09:46 EST Article-I.D.: utah-gr.1291 Posted: Mon Jan 7 16:09:46 1985 Date-Received: Fri, 11-Jan-85 04:52:26 EST References: <216@calmasd.UUCP> <186@usl.UUCP> <1281@orca.UUCP> <2668@dartvax.UUCP> Reply-To: thomas@utah-gr.UUCP (Spencer W. Thomas) Organization: Univ of Utah CS Dept Lines: 94 Summary: In article <2668@dartvax.UUCP> robertm@dartvax.UUCP (Robert P. Munafo) writes: > The resource with the strange type is the "Finder version number >info" resource - this resource is identical in format to type STR (string) >and contains a message indicating the date and version number of the >application.> > >> And now, a question: pending real documentation for ResEdit, can anyone post >> a cookbook method for editing an application's existing icon? So far, no >> changes I have made with ResEdit in already-visible icons have had any >> effect. I think the problem is that once the Finder has seen an application >> with an icon, it thinks that's always the application's icon... >> >> David D. Levine (...decvax!tektronix!orca!davidl) [UUCP] >> (orca!davidl.tektronix@csnet-relay.csnet) [ARPA] > > For some applications, this ican be rather complex task, unless the >resource editor does it for you. Basically, you must find the "BNDL" >resource. This contains the type and ID number of the "Finder version info" >resource, and a number of lists of resource types and ID numbers pointing to: > o Icons that are used by the application (some applications have more than > one type of document icon) > o Files on the disk that are used by the application (these files must > be copied by the Finder along with the application when it is dragged > onto another disk.) >The format for the BNDL resource is too complex for me to describe here - >if you really want to know more about it, see Inside Mac. > For most applications which do not create documents, you will find only >one ICN# resource, containing 256 bytes of data (two icons) - the picture >and the mask. Edit these (remember that the mask should be a solid filled-in >version of the picture). I have managed to use the Resource Editor to give icons to applications previously without them, and to edit icons of applications already on the disk. One thing to remember is that the desktop can be edited with the resource editor - so you can go in and remove the finder's previous knowledge of the application's icon, or just copy the new one in. Here is my procedure for "cleaning up" the desktop: 1. Open the ICN# resource on the desktop. Find icons of all applications that are no longer resident. Record their resource numbers and delete (cut) them. 2. Open the BNDL resource. Open each BNDL in turn and find those that refer to the previously deleted ICN#s. Write down the FREF resource numbers they refer to and the "owner" (creator?) field. Delete these BNDLs. 3. Open the FREF resource. Delete each FREF with a previously determined resource number. 4. Delete the "Finder version info" resources with names equal to the creator fields above. There may still be some other junk lying around, but this gets a lot of it. Now, to add an ICN# to a resource that doesn't have one (none of your applications need have the default icon). 1. Find an application with an icon already. Open it. Also open the application you want to change. 2. Copy the BNDL, ICN#, FREF and "finder version info" resources from the 1st application into yours. (suppose that the finder version info resource is called INFO) 3. Open the BNDL resource and set the creator field to something unique. (Say, "MYAP") 4. Open the ICN# and edit the icon. 5. Close everything and exit ResEdit. 6. Open your application with Fedit. 7. Find the string INFO (or whatever) in the file - it should be near the end. Edit it into "MYAP" (or whatever) and write the block back out. 8. If you are paranoid, go back in to RedEdit and make sure that you now have a resource called MYAP. 9. Set the creator to MYAP with Fedit 10. Set the bundle bit with Fedit. Your icon should now show up. If it doesn't, go clear the bundle bit and make sure that everything matches as it should (resource numbers between BNDL, ICN# and FREF, MYAP resource id is 0, creator of BNDL is MYAP, creator of file is MYAP, type in FREF is APPL, ...) Note that if the MYAP resource is too big (dunno exactly), the finder will refuse to show the icon (this one bit me for a couple of hours). If everything is right, and it still won't show the icon, you may need to do the option-command while booting trick (but you lose your desktop layout). I haven't tried setting document icons in an application, but I assume the process is similar (but be sure to copy the BNDL, FREF and ICN# from an application that creates icons). Happy Hacking! -- =Spencer ({ihnp4,decvax}!utah-cs!thomas, thomas@utah-cs.ARPA) <<< Silly quote of the week >>>