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

Re: [MacPerl] AppleEvents with remote addresses



At 15.31 -0500 1999.08.06, Cameron Ashby wrote:
>I think it's safe to assume that 'ep01' is a system default of some sort.  I
>remember reading some documentation about it.  I'll go back and dig for an
>answer.

Answers are Good.  :)

>Creator and creator type are specified in a union.  Port type 2 is
>ppcByString, so using an 8 character pascal style string is correct.  It
>*should* also work with port type 1 (ppcByCreatorAndType), using the two four
>character codes concatenated (not in a string).

Well, if we can get that working, it would be nice.

>In other news, I have your code working happily on a machine sending events
>back to itself, so obviously the address is packed correctly, but over the
>network I'm getting:
>
># Invalid user reference number  (OS error -928).
>
>First, do you have it working over a network, and if so, is there something
>interesting about your configuration I might duplicate?

Yes, I have done it over the network.  I don't know what your problem might be.

I do.  Well, not off the top of my head.  :)  But I figured how it works is
by registering the username/password with an app.  So you need to specify
MacPerl.  Unfortunately, MacPerl has a problem with responding to events it
sends to itself, so you can't find out if it succeeded or not.

  # need to send event to MacPerl
  $evt = build_event(qw(gtqp lgin McPL), q{'----':TEXT(@), pwrd:TEXT(@)},
      $user, $pass);
  $evt->send_event(kAENoReply);  # no reply is the only way to get it to work
                                 # reliably (well, queueing might work too)

Then you can call events with that name and password at will.  As a side
note, I have a prototype Mac::AppleEvents::Simple working with targets.
This works just dandily for me, over the network:

#!perl -wl
use Mac::AppleEvents::Simple ':all';
use strict;
my($targ, $user, $pass, $evt);

# added pack_ppc() to M::A::S; zone assumed '*' if not supplied
$targ = pack_ppc('MOSS', 'Netscape Communicator', 'Orr');
$user = 'Pudge';
$pass = 'foooo';

$evt = build_event(qw(gtqp lgin McPL), q{'----':TEXT(@), pwrd:TEXT(@)},
    $user, $pass);
$evt->send_event(kAENoReply);

$evt = do_event(qw(WWW! OURL), {targ => $targ},
    "'----':TEXT(\@)", 'http://pudge.net/macperl/');
die $^E if $^E;

__END__

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

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