[comp.sys.mac.programmer] DA's, copying, and MultiFinder

michael@otago.ac.nz (03/20/91)

I have a problem here with a desk accessory I am fixing up (yes, I know, I
would rather it was a small application too). I would like to have a button
that does a Copy of the text the DA is displaying and closes it in one action.
It would seem this is not possible under MultiFinder, because in the words of
Tech Note 181:

> MultiFinder 6.0 and earlier keeps separate scrap variables for each
> partition. MultiFinder only checks to see whether or not to increment the other
> partitions scrapCount variables in response to a user-initiated Cut or Copy. 
> To do this, it watches for a call to _SysEdit (SystemEdit) or a menu event to
> determine if an official Cut or Copy command has been issued.

Because my "Copy and close" button isn't official according to MultiFinder
it doesn't export the scrap to other applications. If I try to make it official
from within the DA by calling SystemEdit(3) weird and unpleasant things happen.
Has anyone else encountered this? Is there a legitimate solution?

Thanks,

Michael(tm) Hamel, Computing Services Centre, University of Otago, New Zealand

MASSACHUSETTS (pl. n.)             
Those items and particles which people who, after blowing their noses, are
searching for when they look into their hankies.

dagr@nmpcad.se (Dag Rende) (03/21/91)

This problem is the same for "small applications". I wrote an application for
converting postscript pictures transferred from a Dec workstation to a PICT on
the scrap. After many tries and readings of Insides ad TNs, i had to implement
the Edit-Copy command to get multifinder let the other application (Word in this
case) be able to see the PICT on it's scrap.

I intended to write a couple of easy-to-use "scrap transformers". They would let
the user of ANY word processor, program editor etc. make simple but time saving
transformations on a part of his text. He marks the text, performs Copy or Cut,
runs the DA or little application, and I am sorry to say that I don't have a
solution to this. Transformations like line sorting, up/down-casing, pretty
printing of C-functions, extraction of ANSI C prototypes, character
translations, ascii-arithmetic etc. would be useful. 
But why should the user have to first start the DA or application, chose
transformation, do Copy, and then quit?

I am looking forward to a solution.

Dag Rende
Institute of Microelectronics, Stockholm, Sweden

lippin@ragu.berkeley.edu (The Apathist) (03/22/91)

SystemEdit(2) does nothing but inform MultiFinder that the scrap has
changed.

(MultiFinder doesn't care what you pass to SystemEdit, and 2 refers to
the gray line in the edit menu, so nothing happens when you get down
to the real SystemEdit.)

					--Tom Lippincott
					  lippin@math.berkeley.edu

	"No problem is insoluble given a big enough plastic bag."
					--Tom Stoppard, _Jumpers_

d88-jwa@byse.nada.kth.se (Jon W{tte) (03/22/91)

In article <> lippin@ragu.berkeley.edu (The Apathist) writes:

   (MultiFinder doesn't care what you pass to SystemEdit, and 2 refers to
   the gray line in the edit menu, so nothing happens when you get down

This is, of course, wrong :-)

IM says that SystemEdit ( 0 ) is Undo, 2 is Cut, 3 is copy &c.
The method of calling SystemEdit is OK, though; just pass 1 to
it instead.

Now, what happens when you call SystemEdit from a DA ?

						h+@nada.kth.se
						Jon W{tte
--
"The IM-IV file manager chapter documents zillions of calls, all of which
seem to do almost the same thing and none of which seem to do what I want
them to do."  --  Juri Munkki in comp.sys.mac.programmer