从另一个应用程序接收文本

发布于 2024-09-02 00:32:03 字数 306 浏览 4 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄离 2024-09-09 00:32:03

由于您正在编写客户端和服务器应用程序,因此分布式对象可能是比 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文