Mac::Glue with Remote Computers

| | Comments (0)
I never got around to figuring out how to do remote Apple events with Mac OS X. All I knew is that the old method from Mac OS of filling in a complex data structure didn't work.

It worked great on Mac OS, but wouldn't work on Mac OS X. So tonight I decided to figure it out, and I did. Instead of packing the data structure, I just construct a URL. That's all. Something like eppc://pudge@mac.example.com/Finder. And Mac::Glue makes it even simpler:

# normal way, for local Finder
$finder = new Mac::Glue 'Finder';
 
# method for remote Finder
$finder = new Mac::Glue 'Finder', eppc => Finder => 'mac.example.com';

That's it. Then use $finder as though it were local. Of course, there is the issue of security. You can pass the username and password to the constructor, or just pass the username and get a dialog box asking for the password. If neither is included, you'll get a dialog box, too. Either way, click "Add to Keychain?" and you never have to see the dialog box again, for that username/hostname combination.

There's also a place in the URL for specifying UID or PID, in those cases where more than one app of that name is running. I tested this and it didn't work, it just chose one and sent the event to that app every time, no matter what. Hm.

Regardless, it's working. Send events to your other Macs. Astound your friends. Requires today's newly updated Mac::Carbon, Mac::AppleEvents::Simple, and Mac::Glue. use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on October 31, 2003 9:44 AM.

Mac-Glue-1.14 Released was the previous entry in this site.

Mac-AppleEvents-Simple-1.09 Released is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.