[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Apple Events... More Examples Available?



Kent Cowgill <kentc@intersites.com> writes:
>Matthias Ulrich Neeracher <neeri@iis.ee.ethz.ch> writes:
>>Kent Cowgill <kentc@intersites.com> writes:
>[snip]
>>One of my (as yet unwritten) philosophical principles in translating toolbox
>>calls is that pointer/length pairs get combined into a single scalar
>>value, so the c function:
>>AEPutParamPtr(AE, 'duh?', 'TEXT', "Hello, World", 12)
>>in Perl becomes
>>AEPutParam(AE, 'duh?', 'TEXT', "Hello, World");
>
>That's helpful to know! :D
>
>Would that be an appropriate item for the README that comes with MacPerl?
>Parhaps, at the very least, a MacintoshToolbox.README? :)

Yes, the principle should end up somewhere in a Pod in the Mac directory,
probably  Mac::Toolbox.pod

>>>but MacPerl complains about any additional parameters I try to use.
>>>Perhaps I'm misunderstanding what's expected as a parameter for the
>>>"PARMS...".
>>
>>MacPerl does rudimentary checking that the number of arguments you supply
>>corresponds to the number of placeholders in FORMAT.
>
>>From the Shuck documentation, it appears as though mulitple parameters
>should appear as such:
>
>AEBuildAppleEvent("WWW‡", "RqRp", typeApplSignature, "WWW‡", 0, 0,
>"Kmsg:1", "Ksta:0", "Kpid:345634", "Kver:1")

Ah now, that's not the way it works.

>which didn't work...  this, however, did:
>
>AEBuildAppleEvent("WWW‡", "RqRp", typeApplSignature, "WWW‡", 0, 0, "Kmsg:1
>, Ksta:0 , Kpid:345634 , Kver:1")

Yes. The FORMAT string describes the entire event.

>I'm not sure if this is a documentation issue, or just a
>misinterpretation on my part.

It's probably a documentation issue. You will notice that in newer Toolbox
modules, there is even less documentation, as I think we don't have the time
and resources to match Inside Macintosh, so what I try to do is to make the
mapping obvious and only document the un-obvious parts.

AEBuildAppleEvent, for instance, is built on an AEGizmos routine with pretty
much the same name and interface.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "One fine day in my odd past..." -- Pixies, _Planet of Sound_