Re: NSDistributedNotifications and scripting languages
Re: NSDistributedNotifications and scripting languages
- Subject: Re: NSDistributedNotifications and scripting languages
- From: has <email@hidden>
- Date: Mon, 4 Aug 2008 22:43:55 +0100
Jens Alfke wrote:
I was wondering if anyone had any ideas about sending notifications
to Cocoa applications using either Ruby, or PHP? I want to send
notifications using a cocoa application to another cocoa application
and / or send notifications from a web based application.
Notifications are a general broadcast mechanism, used to announce that
something of interest has happened when you don't know or care who's
listening. If you're looking for point-to-point or two-way
communication, there are other, more suitable, IPC mechanisms for that.
AppleEvents are the standard way to do this. Cocoa's scriptability
APIs make it pretty easy to implement AppleEvent/AppleScript support.
From Ruby you can use the bridge to invoke AppleScript, and from any
language you can launch an AppleScript as a separate task or use the
'osascript' tool to send raw AppleEvents.
If the OP is writing both client and server applications for their own
use and both are using Cocoa, I'd suggest looking at Distributed
Objects first. Apple events can be a bear to do well - the main reason
for using them is if you need to talk to third-party applications, or
allow third-parties to talk to yours.
Also, I'd strongly recommend Ruby or Python over PHP since the first
two have excellent and very mature Apple event and Cocoa bindings
while PHP doesn't have either.
HTH
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden