[net.micro.mac] RMover and ResEdit answers and question

davidl@orca.UUCP (David Levine) (01/03/85)

In article <186@usl.UUCP> jih@usl.UUCP (Juha I. Heinanen) writes:
>All copies of RMover that I have got don't display the cursor properly.
>Instead the watch symbol acts as a cursor.  Is that common to all of you 
>or has someone found a way to make the cursor show up?

The cheap solution is to invoke any desk accessory that uses the arrow cursor
(Calculator works fine) and then close it.  This turns the cursor into an 
arrow and leaves it.  The problem seems to be that RMover does not reset its
cursor when initiated (thus, the watch remains from the loading-from-disk
phase).  Anybody have a real fix for this one?

RMover has other problems.  One annoying one is that you can't double-click 
on a filename to open it, which is the case in every other such "Open..." 
dialogue box I've encountered.

The Resource Editor (ResEdit), even Version 0, seems to be superior to RMover.
The only problems I've encountered with ResEdit so far are that it is big
(96K), its font editor seems to be a little buggy, and there's no 
documentation.  If you haven't yet received ResEdit at your site, wait a bit;
it was posted quite recently.

ResEdit is powerful.  For example, you may have noticed that downloaded
applications all appear as "generic" application icons, but some have ICN#
resources buried within them.  I have figured out a way to make these "buried" 
icons appear, using ResEdit and Fedit (File and Volume editor), but I don't 
completely understand what I'm doing:

	Using RMover or ResEdit, open the application and verify that it has 
	one or more ICN# resources.  You can examine them to see what the 
	application's icon will look like, and even edit them (I think).
	
	Now, check the list of the application's resources for the one 
	unusual one.  With the exception of mFinder, all the applications 
	I've seen that have their own icons also have a resource with a name 
	I've never seen before.  Often this name is a person's name or the name
	of the program itself.  For example, the unusual resource in Missile 
	Command is RJUN.  In Mouse Stampede, it's MOUS.  If you open this 
	resource, it is a short bit of code (about 50 bytes).  

	Leave ResEdit and re-open the application with Fedit.  Choose "File
	Finder Attributes" from the "Display" menu.  Change the application's
	Creator to the name of the unusual resource, if necessary, and set the
	Bundle bit.  (I can't explain why you can't do this from within 
	ResEdit, but if it's possible I haven't found out how.)

	When you leave Fedit, the application should have its own icon.

Warning: do this on a scratch disk.  When I tried to activate the icon for
mFinder, I managed to trash the icons of every "generic" application on that
disk and create a disk that would invariably cause a "sad mac" if you tried to
boot from it.  As I said, I don't quite understand what I'm doing.

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]

P.S.  Is there an ASCII chart desk accessory?  Sidekick for the IBM PC has 
      one, why doesn't the Mac?

ward@hao.UUCP (Mike Ward) (01/03/85)

> 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...

When the Finder opens an application that has the bundle resources (types BNDL,
FREF, ICN# and *name* (that's the one with the type the same
as the creator)) in the resource fork, and the bundle bit set,
it moves the bundle resources from the application file into the desktop file.
This is
where it goes to find the icon to display on the screen.  Changing
the ICN# resource in the application file will not have any effect
on what you see unless you delete the Desktop file (hold down
option and command as the disk is being booted) or delete all
the required resources from the Desktop file.  The first method
will eliminate all your folders, and the second method will destroy
many disks until you figure out just what must and must not be
removed.

-- 

Michael Ward, NCAR/SCD
UUCP: {hplabs,nbires,brl-bmd,seismo,menlo70,stcvax}!hao!ward
ARPA: hplabs!hao!sa!ward@Berkeley
BELL: 303-497-1252
USPS: POB 3000, Boulder, CO  80307

robertm@dartvax.UUCP (Robert P. Munafo) (01/04/85)

>    Now, check the list of the application's resources for the one 
>    unusual one.  With the exception of mFinder, all the applications 
>    I've seen that have their own icons also have a resource with a name 
>    I've never seen before.  Often this name is a person's name or the name
>    of the program itself.  For example, the unusual resource in Missile 
>    Command is RJUN.  In Mouse Stampede, it's MOUS.  If you open this 
>    resource, it is a short bit of code (about 50 bytes).

   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.  In the case of my Missile Command game the string says,
"Game Vers. 2.3   August 18,1984" .  This text cannot be interpreted
by the Finder, but nevertheless, Inside Mac says it has to be there.
(I think it's in the "Putting Together an Application" section.)  The
type, "RJUN" in this case, must be unique for each different application.
   (By the way, "RJUN" came from the original name of the source code
file on the Lisa, "Rjunk27", an unlikely name which would not conflict
with other files on the ProFile.)
 
> 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), and hold down the Option and Command keys
simultaneously when the Finder is starting up.  This should show the new
icon (although it will also lose all the folders and the "Get Info" data.)

 
> P.S.  Is there an ASCII chart desk accessory?  Sidekick for the IBM PC has 
>       one, why doesn't the Mac?

I'd like to see this, too - perhaps someone can hack together a modified
"Key Caps".  If it could also display different fonts, we would be able to
use it to figure out the keyboard layout for Cairo and other bizarre fonts.
-- 
  
  Robert P. Munafo   ...!{decvax,cornell,linus}!dartvax!robertm

dolf@uva.UUCP (Dolf Starreveld) (01/04/85)

The strange resource mentioned is the so called "signature" resource of
an application. It must have a resource type equal to the files creator,
in order to enable the finder to associate the application with its specific
data, such as icons. This specific data is specified in the so called
bundle, a resource (type BNDL), that specifies the icons the finder must
display for the application, as well as for the documents created by the
application. In the bundle usually there are references to three types
of resources:
1) To the signature resource. By the way, the signature may have any
type, must have resource id 0, and must be the first resource defined for
the application.
2) The ICN# resources. Icon lists contain an icon and its mask for each
resource id. Such a pair must be defined for every different file typ
the application creates, including its own file, with the type APPL.
3) FREF resources (file references), which tell the finder wich ICN#
belongs to which file type.

Some applications do not have a bundle resource. In the case the finder
assigns them the default icons for application (the hand icon) and documents.


-- 
			Dolf Starreveld
			Computer Science Department
			University of Amsterdam
			The Netherlands

			{philabs, decvax, seismo}!mcvax!uva!dolf

richr@iddic.UUCP (Rich Rodgers) (01/05/85)

In article <1281@orca.UUCP> davidl@orca.UUCP (David Levine) writes:

>ResEdit is powerful.  For example, you may have noticed that downloaded
>applications all appear as "generic" application icons, but some have ICN#
>resources buried within them.  I have figured out a way to make these "buried" 
>icons appear, using ResEdit and Fedit (File and Volume editor), but I don't 
>completely understand what I'm doing:

This procedure can be done using SetFile instead of Fedit if you do not have
Fedit (as I don't).

>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...

When the finder finds an application with the bundle bit set it searches for
three files... ICN#, BNDL, FREF and using the BNDL file it finds one more
which is the file you referred to as the funny one usually having the program
or programmers name in 4 letters.  It then appends the ICN#, BNDL, and FREF
files to the simalarly named files in the DeskTop file assigning new numbers
to file numbers to fit on the disk.  It also copies the funny file into the
DeskTop.  Thus if you want to change the icon of a file you must change
the icon as it appears in the DeskTop ICN# file.  Or you can change it in
the file before you set the bundle bit, then when the finder goes to do it's
thing, it will copy the new icon to the DeskTop.  If you copy the file to
another disk, the icon from the application is shown if the bundle bit is
set, not the icon from the DeskTop.  Sorry if this is hard to read, but...
getting tired...


What?  me ski?
	NO way!

Rich Rodgers

These are not views, they are facts which do not represent anything.

ech@spuxll.UUCP (Ned Horvath) (01/05/85)

> 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...

Unfortunately, the Finder only believes its Desktop file once it copies the
icons out of the application.  Rather than trash the Desktop, you might use
ResEdit to find the ICN# for the application IN THE DESKTOP, edit it there,
then Copy/Paste it back into the application.  Note that you will have to
cut out the old ICN# in the application, and change the resource ID of the
modified one in the application if you want the change to propagate to other
disks with the application.

Watch out for a nasty I have tripped over: the Finder apparently NEVER removes
BNDLs, ICN#s, FREFs, and the 'name' resources from the Desktop.  When my
Desktop started approaching 10k (too much downloading, tsk) I HAD to clobber
the Desktop: the finder started reporting too little memory to eject the
startup disk, and inviting me to remove 'one or more dimmed disk icons' (of
which there were, of course, none).

Is that why MacTerminal doesn't set the Bundle Bit on downloads?  To give you
the chance to get it somewhere safe (like off the MacTerminal disk!) first?

=Ned=

thomas@utah-gr.UUCP (Spencer W. Thomas) (01/08/85)

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 >>>

larry@orion.UUCP (L.MURPHY) (01/13/85)

()
I recently received ResEdit which, when used with Set File, provides me
with all the Icon manipulation that I need (at least right now). I don't
have Fedit; I have RMover but I don't think I need it anymore.

The following "cookbook" method really originates from trying out the
suggestions made by David Levine & Rich Rodgers from Tektronix, Ned
Horvath from AT&T-IS, and especially Spencer Thomas from Univ. of Utah.

1. Making a "Hidden" Icon Appear

* Use "ResEdit" to open the application (e.g., Othello). Open its BNDL
  resource to find out its OwnerName (in this case, DAVY). You can open
  the ICN# resource to look at the icon(s). Quit ResEdit.
* Use "Set File" on the application. Set its Bundle bit and set Creator =
  OwnerName. When you quit "Set File", the icon should appear.

2. Copying/Editing Icon to Application having just the default Icon

* Use "ResEdit" to open an application with an icon (e.g., BinHex) and
  an application with just the document icon (e.g., Set File). Copy BNDL,
  ICN#, and FREF resources from the first to the second application.
* Open the BNDL resource of the second application and set OwnerName to
  a unique four letter name (e.g., SETF). Close BNDL.
* Create a new Type Name for the second application with Type Name =
  the selected OwnerName. Open this new resource and use "Get Info" to
  set its ID=0.
* (Optional) Edit the icon by opening ICN#. Quit ResEdit.
* Use "Set File" on the application. Set its Bundle bit and set Creator =
  the selected OwnerName. Quit "Set File". The new icon should appear.

3. Editing an Icon already recognized by the DeskTop

* Use "ResEdit" to open the application's ICN#. Note the resource id#
  using Get Info. Cut the ICN# resource out of the application.
* Open the Desktop's ICN# resource. Edit the application's icon there
  and then copy it back to the application.
* Open the application's ICN# resource to change the resource id# back
  to its original number. Quit "ResEdit" and the edited icon should 
  appear.

Hope this helps...
				Larry Murphy
				AT&T Information Systems Laboratories
				Holmdel, NJ	
				..!hou5e!orion!larry