[comp.sys.mac.programmer] ResEdit Clipboard Format?

singer@endor.harvard.edu (Rich Siegel) (06/06/88)

Could someone in the know kindly post some information on the scrap format
that ResEdit uses, so that an application can handle resources copied to
the ClipBoard in ResEdit?

Thanks much.

Rich


Rich Siegel
Quality Assurance Technician
THINK Technologies Division, Symantec Corp.
Internet: singer@endor.harvard.edu
UUCP: ..harvard!endor!singer
Phone: (617) 275-4800 x305

dorourke@polyslo.UUCP (David O'Rourke) (06/07/88)

In article <4717@husc6.harvard.edu> singer@endor.UUCP (Rich Siegel) writes:
>Could someone in the know kindly post some information on the scrap format
>that ResEdit uses, so that an application can handle resources copied to
>the ClipBoard in ResEdit?

  The "problem" with ResEdit isn't that it doesn't post to the clipboard
in a "known" format, it's that it doesn't covert the data to a "common"
format.

  It is my understanding that the format of the data on the Clipboard is
just the same as the resource that was copied.  So if you were to copy a
"BNDL", ResEdit would put a resource of type "BNDL" on the clipboard.  Now
most applications don't support "BNDL" data types, so they don't allow you
to "import" them.

  Most applications only import things from the clipboard such as "TEXT" or
"PICT" resources, and selected custom resource formats.

  Hope this helps.  I believe the information about to be accurate, but
I've been wrong before, and with so many different versions of ResEdit
running around you never know what they're going to do.

-- 
David M. O'Rourke

Disclaimer: I don't represent the school.  All opinions are mine!

guido@cwi.nl (Guido van Rossum) (06/08/88)

In article <3111@polyslo.UUCP> dorourke@polyslo.UUCP (David O'Rourke) writes:
>  It is my understanding that the format of the data on the Clipboard is
>just the same as the resource that was copied.  So if you were to copy a
>"BNDL", ResEdit would put a resource of type "BNDL" on the clipboard.  Now
>most applications don't support "BNDL" data types, so they don't allow you
>to "import" them.

It's your guess against mine, but I don't believe you.  First, ResEdit
can copy and paste a collection of resources, so it must have a way of
storing many resources in a single scrap entry.  Second, to get anything
from the clipboard (without cheating) you must pass a type (a
four-letter word) to GetScrap.  My guess is that ResEdit uses its own
type, and undoubtedly someone with a debugger can peek into the scrap
mgr's administration to see what that type is.  From then on,
decyphering the information that's there should be simple enough.  (You
might also have a look at the ScrapBook file, if that's still
supported).  Good luck!
--
Guido van Rossum, Centre for Mathematics and Computer Science (CWI), Amsterdam
guido@piring.cwi.nl or mcvax!piring!guido or guido%piring.cwi.nl@uunet.uu.net

holland@mips.csc.ti.com (Fred Hollander) (06/11/88)

In article <351@piring.cwi.nl> guido@cwi.nl (Guido van Rossum) writes:
>In article <3111@polyslo.UUCP> dorourke@polyslo.UUCP (David O'Rourke) writes:
>>  It is my understanding that the format of the data on the Clipboard is
>>just the same as the resource that was copied.  So if you were to copy a
>>"BNDL", ResEdit would put a resource of type "BNDL" on the clipboard.  Now
>>most applications don't support "BNDL" data types, so they don't allow you
>>to "import" them.
>
>It's your guess against mine, but I don't believe you.  First, ResEdit
>can copy and paste a collection of resources, so it must have a way of
>storing many resources in a single scrap entry.  Second, to get anything

My *guess* is that it stores the collection of resources as a number of
individual scrap entries.  (You're not limited to a single Scrap entry)

>from the clipboard (without cheating) you must pass a type (a
>four-letter word) to GetScrap.  My guess is that ResEdit uses its own
>type, and undoubtedly someone with a debugger can peek into the scrap
>mgr's administration to see what that type is.  From then on,

When it wants to retrieve all the resources from Scrap, it can look at all
the types that are in Scrap and retrieve each one by its type.

>decyphering the information that's there should be simple enough.  (You
>might also have a look at the ScrapBook file, if that's still
>supported).  Good luck!


Fred Hollander
Computer Science Center
Texas Instruments, Inc.
holland%ti-csl@csnet-rela

The above statements are my own and not representative of Texas Instruments.

freek@uva.UUCP (Freek Wiedijk) (06/12/88)

In article <351@piring.cwi.nl> guido@cwi.nl (Guido van Rossum) writes:
>It's your guess against mine, but I don't believe you.  First, ResEdit
>can copy and paste a collection of resources, so it must have a way of
>storing many resources in a single scrap entry.  Second, to get anything
>from the clipboard (without cheating) you must pass a type (a
>four-letter word) to GetScrap.  My guess is that ResEdit uses its own
>type, and undoubtedly someone with a debugger can peek into the scrap
>mgr's administration to see what that type is.  From then on,

Unfortunately, your guess is wrong. The solution is that Resedit *doesn't*
copy and paste collections of resources using the scrap. If you leave Resedit
with a couple of resources on the clipboard, and you enter it again, only one
of the resources is still there, and name and ID are forgotten.

Resedit uses a file called ResEdit.Scrap to store collections of resources on
the "scrap". Try watching ResEdit under MultiFinder ...

-- 
Freek Wiedijk  <the pistol major>                  UUCP: uunet!mcvax!uva!freek
#P:+/ = #+/P?*+/ = i<<*+/P?*+/ = +/i<<**P?*+/ = +/(i<<*P?)*+/ = +/+/(i<<*P?)**

olson@endor.harvard.edu (Eric K. Olson) (06/14/88)

I tried some experiments with ResEdit 1.2d0 to try to answer some questions
regarding the format of ResEdit's scrap:

When I copy a single resource of any type in ResEdit, open the ScrapBook,
and paste it there, the four-letter type code for the resource appears
in the Scrapbook window (lower right corner).  "This item has no text or
picture" appears in the main part of the Scrapbook window.  This means that
the Clipboard is getting the resource, and the Scrapbook it willing to 
"Import" it, but it doesn't know how to display it.  I can exit ResEdit,
(thus destroying ResEdit's local scrap and avoiding that confusion)
re-launch ResEdit, create a new file, copy the the resource out of the
Scrapbook, and paste it into the new file.  NOTE:  The resource loses its
ID # when it passes through the system clipboard (presumably getting a
UniqueID() number).

If I copy multiple resources in ResEdit, and pass them through the
system clipboard, only one comes out the other end.  I didn't bother
to figure out which one because if I want one, I'll only select one.

I'm not sure that all versions of ResEdit work this way, because I have
been in the habit of "Stealing" PICT resources by creating a dummy
PICT in the scrapbook and replacing it with the PICT I wanted via ResEdit.
I can't imagine I wouldn't have tried the above first (this was a good
two years ago).  So if your ResEdit doesn't work this way, go on down
to your local Rent-a-center and look at all the new ResEdits for '88!

-Eric

          Lexington Software Design:  Tomorrow's Software Yesterday

Eric K. Olson     olson@endor.harvard.edu     harvard!endor!olson     D0760
   (Name)                (ArpaNet)                 (UseNet)        (AppleLink)

steele@Apple.COM (Oliver Steele) (06/14/88)

In article <3111@polyslo.UUCP> dorourke@polyslo.UUCP (David O'Rourke) writes:
>  It is my understanding that the format of the data on the Clipboard is
>just the same as the resource that was copied.  So if you were to copy a
>"BNDL", ResEdit would put a resource of type "BNDL" on the clipboard.  Now
>most applications don't support "BNDL" data types, so they don't allow you
>to "import" them.

This is exactly right, for single resources.  If multiple resources are
cut or copied, they're placed in the temporary file 'Resedit.scrap' in the
same folder as ResEdit, whether they're the same type as each other or
not; if you copy multiple resources, leave ResEdit, and relaunch, they
won't be there any more.  If multiple resources are in the scrap and you
paste into a file in ResEdit, it's only the first resource that gets
pasted.  The Scrapbook lists resource types in alphabetical order, not by
saved order, so this is hard to see.

Other notes:  Pastes do not check to see whether you're going to replace
an existing resource file, and "Y", "N", and "C" now work, MPW-fashion,
in response to the dialogs.

 ----------------------------------------------------------------------------
 Oliver Steele						steele@apple.com
 Apple ATG

 Disclaimer:  I don't know anyone who works on ResEdit.  I just tried it.

earleh@eleazar.dartmouth.edu (Earle R. Horton) (06/14/88)

In article <12105@apple.Apple.COM> steele@apple.apple.com.UUCP 
	(Oliver Steele) writes:
>... "Y", "N", and "C" now work, MPW-fashion,
>in response to the dialogs.

Don't you mean, "MicroSoft Fashion" as in MicroSoft Word, version 1.00?
Let's give credit where credit is due.  I think you might have the germ of
a "look and feel" lawsuit here...
 
P.S. I want my MiniFinder back!
*********************************************************************
*Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755   *
*********************************************************************