home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!comp.vuw.ac.nz!waikato.ac.nz!ldo
- From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
- Newsgroups: comp.sys.mac.hypercard
- Subject: Re: Sending arbitrary AppleEvents to other applications
- Message-ID: <1993Jan29.165825.13525@waikato.ac.nz>
- Date: 29 Jan 93 16:58:25 +1300
- References: <1993Jan27.191358.21956@nwnexus.WA.COM>
- Organization: University of Waikato, Hamilton, New Zealand
- Lines: 36
-
- In article <1993Jan27.191358.21956@nwnexus.WA.COM>, phaedrus@halcyon.com (Mark Phaedrus) writes:
- > I'm trying to use HyperCard 2.1 to prototype an interface to an
- > AppleEvent-driver background application, and I'm running into problems.
- > I'd been told that HyperCard could send and receive arbitrary AppleEvents
- > (events with multiple parameters stored under various keywords), and I can see
- > from the documentation how I would go about receiving such events (using an
- > appleEvent handler, requesting data by keyword), but I don't see any mention
- > of how to construct such multiple-keyword AppleEvents to send to other
- > applications. Do I need to use an XCMD or XFCN for this, and if so could
- > someone point me towards one?
-
- Yes, you need to do it with XCMDs or XFCNs. There are in fact more than one
- set of these around. There's one extensive set done by Edmund Lai at Apple,
- that lets you make individual AppleEvent Manager calls to construct and send
- an AppleEvent. I'm not sure if this is available on the net anywhere.
-
- I've got a set similar to this. Actually, at the time I wrote it, I didn't
- know what Ed Lai had done. But having seen his code (on one of the developer
- CDs), I think mine is a little easier to use, because I pass around AppleEvent
- descriptors as literal hex strings, instead of pointers to blocks of memory.
- This simplifies memory management (HyperCard takes care of all allocation/
- disposing of strings!), but it is admittedly slower converting descriptors
- back and forth between formats all the time.
-
- Would there be much interest if I were to make my externals available on the
- net somewhere? You do really have to read the AppleEvent Manager chapter in
- Inside Mac VI in order to use them properly, but I've found them useful
- for experimentation. For example, I've been using them with FileMaker Pro over
- the last week or two to try to perform some database manipulations that are
- just too hard to do from within FileMaker itself. And to learn about the
- AppleEvent Object Model, while I'm at it.
-
- Lawrence D'Oliveiro fone: +64-7-856-2889
- Computer Services Dept fax: +64-7-838-4066
- University of Waikato electric mail: ldo@waikato.ac.nz
- Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
-