从另一个应用程序接收文本
我正在使用 Cocoa/Objective-C 构建一些家庭自动化软件。主应用程序将有一个最小的 GUI,并且很可能仅由状态栏图标表示。
我正在使用专有的语音转文本软件 (MacSpeech Dictate),该软件接受我的语音命令并将其转换为纯文本。然后我需要将此纯文本发送到我的应用程序进行解析。有没有办法将字符串发送到 Cocoa 应用程序? AppleScript 能做到这一点吗?如何使我的应用程序中的 NSString 字符串“可用”以接收传递的字符串?
由于超出此问题范围的原因 - 无法将命令直接输入到我的应用程序中。
预先非常感谢,
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 directly into my app.
Many thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您正在编写客户端和服务器应用程序,因此分布式对象可能是比 AppleScript 更好的选择。两者都有各自的问题,但 DO 的主要好处是实施起来更简单。
http://developer.apple.com/mac/library/documentation /cocoa/conceptual/DistrObjects/
http://jens.mooseyard.com/2009 /07/分布式对象的微妙危险/
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/