home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / hypercar / 4981 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.7 KB

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