[comp.sys.mac.programmer] _Launch on a

jcd2@ukc.ac.uk (J.C.Doig) (06/25/91)

I am trying to write a bit of code that will open a specific document in an
application that (may) already be running.  I understand from TN205 that
MF currently does a sneaky grab of the menu bar and patches the SFD - can
I jump into that code ?  Anyone know how ?

I assume I'll have to write 2 bits of code - one for already-launched apps
and one for not-open apps. There was a mention (in TN205 as well I think),
that the MF fudge was going to be taken away - has it been done ? If not,
are the plans to make it one call (regardless if the app is open or not) ?

Jeremy Doig

rmh@apple.com (Rick Holzgrafe) (06/28/91)

In article <7839@harrier.ukc.ac.uk> jcd2@ukc.ac.uk (J.C.Doig) writes:
> I am trying to write a bit of code that will open a specific document in 
an
> application that (may) already be running.

Piece of cake in System 7 (Process Manager and AppleEvents), very 
difficult in System 6.0.x and earlier. Older and wiser heads may correct 
me, but I wouldn't want to tackle this in System 6.0.x; it would be *very* 
kludgy and would probably break every time you looked at it cross-eyed. 
And any solution that worked in 6.0.x would fail under System 7.

A note to the nervous: I know a lot of us are still running System 6.0.x 
and earlier, and will be for a long time. I'm not recommending that such 
folks be abandoned or forgotten. It's just a fact that some things that 
are hard to do in 6.0.x (and impossible to do in a clean, supported 
fashion) are simple in 7.0. If it weren't so, we wouldn't have built 
System 7!

Hope this helps.

==========================================================================
Rick Holzgrafe              |    {sun,voder,nsc,mtxinu,dual}!apple!rmh
Software Engineer           | AppleLink HOLZGRAFE1          rmh@apple.com
Apple Computer, Inc.        |  "All opinions expressed are mine, and do
20525 Mariani Ave. MS: 3-PK |    not necessarily represent those of my
Cupertino, CA 95014         |        employer, Apple Computer Inc."

ari@eclectic.COM (Ari Halberstadt) (06/28/91)

In article <7839@harrier.ukc.ac.uk> jcd2@ukc.ac.uk (J.C.Doig) writes:
>I am trying to write a bit of code that will open a specific document in an
>application that (may) already be running.  I understand from TN205 that
>MF currently does a sneaky grab of the menu bar and patches the SFD - can
>I jump into that code ?  Anyone know how ?

Apple Events are an easy and compatible way of asking applications to do
things. Apple Events come with system 7.0. Don't try to munge MultiFinder, and
forget that old technote about launching, unless you *really* must have system
6.0 compatability. Get IM-VI as soon as it hits the UK, or get hold of the
online version from one of the developer CDs.
-- 
Ari Halberstadt       ari@eclectic.com             #include <stdisclaimer.h>
Ramsgate (n.) All institutional buildings must, by law, contain at least twenty
ramsgates. These are doors that open the opposite way to the one you expect.
	-- D. Adams & J. Lloyd "The Meaning of Liff", p75.