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

[MacPerl] Apple Events without parameters



I'm trying to get into AppleEvents using MacPerl, and I want to start with
something simple.  However, I'm still getting stuck :-(

My script is supposed to be a simple modification of the example in the
macperlcat.pod (posted below).  All I want to do, for now, is just to launch
Internet Explorer.  The relevant event description from aete.converter is:

@EVENT "run", "", 'aevt', 'oapp'

So, I shouldn't need any parameters, my event class is aevt, my event
id=oapp etc.  I keep getting an error from my AEBuildAppleEvent command, so
I'm pretty sure I've got that wrong (I've tried a number of variations,
below I'm just including one ;-).

If anybody has any pointers on creating AppleEvents without parameters, I'd
be very grateful!

Thanks,
Rick

#!perl -w

use Mac::AppleEvents;

my $ae;

%ae = (
target => 'MSIE',      # creator ID
class => 'aevt',       # event class
id => 'oapp',
params => ("'----':obj{want:null(),from:null(), form:null(), seld:null()}")
);

# now build apple event
$event = AEBuildAppleEvent(
    $ae{'class'},
    $ae{'id'},
    'sign',
    $ae{'target'},
    0,
    0,
 @{$ae{'params'}}
) or die($^E);

$reply = AESend($event,kAEWaitReply) or die($^E);

AEDisposeDesc($event);
AEDisposeDesc($reply);


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org