Re: Messaging Cocoa apps through Terminal
Re: Messaging Cocoa apps through Terminal
- Subject: Re: Messaging Cocoa apps through Terminal
- From: has <email@hidden>
- Date: Wed, 3 Mar 2010 17:22:03 +0000
Ulai Beekam wrote:
> How can I send messages to my Cocoa app through the terminal? Say something like
> MyGreatMp3Player.app --sendAdvancedMessageThatIsNotInTheUI create100EmptyPlaylists
I think the simplest way would be to write yourself a simple command line tool that uses Distributed Objects. I do this to control one of my own Cocoa-based apps from the command line. See:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/DistrObjects/DistrObjects.html
DO is no panacea, mind; e.g. see:
http://jens.mooseyard.com/2009/07/the-subtle-dangers-of-distributed-objects/
but if you understand and can work within its limitations, it's a very quick and easy way to get 'low-level' access to the known innards of Cocoa apps.
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