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

[MacPerl] AppleEvents via Net? (spooky actions at a distance)



I'm trying to use Mac Perl to fire up a set of distributed apps on idle
workstations overnight.

I suppose I could just do the following:

sub RenderLaunch {
  MacPerl::DoAppleScript qq{
    tell application "Finder" of machine "MarsObserver" of zone "Deimos"
      open file "RenderAgent" of folder "Renderers" of folder \
       "Extensions" of folder "System Folder" of startup disk
    end tell
  }
}
RenderLaunch;

but that's AppleScript, and in raw form it brings up an annoying dialog asking
for a password (which is not nice when I'm launching the thing with Cron while
I'm on a river in my kayak :-).

Instead, I've been playing with code like the following:

sub RenderLaunch {
    $eventClass = "FNDR";
    $eventID = "open";
    $targetID = "0, $portName, $portlocation, null";
    $address = AECreateDesc typeTargetID, $targetID              || die $^E;
    $event = AECreateAppleEvent $eventClass, $eventID, $address  || die $^E;
    AEDisposeDesc $address                                       || die $^E;
    $reply = AESend($event...
}
RenderLaunch;

My current difficulties stem from finding a way to create $targetID (actually,
find the port name and location) for a remote Mac.  (Is there an interface to
IPCListPorts()?)  Once I've got the name and location, if I can get that info,
how should I reference it in the AECreateAppleEvent call?

Even better, is there a way to specify the authentication info (user name and
password) for the program link on the remote machine, without popping up a
dialog on an unattended machine?

Thanks in advance for any pointers.


Richard



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch