• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Messaging Cocoa apps through Terminal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: How a window was closed?
  • Next by Date: Re: Help Book Icon in Xcode 3.2
  • Previous by thread: Re: Messaging Cocoa apps through Terminal
  • Next by thread: Re: Messaging Cocoa apps through Terminal
  • Index(es):
    • Date
    • Thread