Receiving Text From Another Application
I'm building some home automation software with Cocoa/Objective-C. The main application will have a minimal GUI and will most likely be represented by a status bar icon only.
I'm using proprietary speech-to-text software (MacSpeech Dictate) that takes my voice command and converts it to plain text. I then need to send this plain text to my app for parsing. Is there a way to send a string to a Cocoa application? Could AppleScript achieve this? How would I make the NSString string in my app "available" to receive the passed string?
For reasons that are beyond the scope of this question - it is not possible to dictate the command d开发者_开发技巧irectly into my app.
Many thanks in advance,
Since you are writing both client and server apps, Distributed Objects might be a better choice than AppleScript. Both have their problems, but DO's main benefit is that's much simpler to implement.
http://developer.apple.com/mac/library/documentation/cocoa/conceptual/DistrObjects/
http://jens.mooseyard.com/2009/07/the-subtle-dangers-of-distributed-objects/
精彩评论