从 MAC OS X 应用程序中提取信息
我有一个简单的问题,我会直截了当。
假设我正在运行一个第三方可可应用程序,其中有一个聊天框。好吧,我需要从另一个应用程序实时捕获聊天框中的文本,并使用该信息实时写入日志文件。
我确信有办法,只是不知道从哪里开始。我有使用 cocoa 和 Objective C 的经验,我在 iPhone 应用商店里有一些应用程序。
非常感谢
I have a simple problem, I will be straighforward.
Suppose I have a third-party cocoa application running that has a chat box inside. Well, I need to capture the text inside that chat-box in real time from another application and write a logfile in real time with that information.
I am sure there is a way, I just don't know where to start. I have experience with cocoa and objective C, I have some apps in the iphone app store.
Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除非应用程序具有适当的脚本功能(例如AppleScript)或具有某种外部API,否则您将无法执行此操作。
Unless the app is suitably scriptable (e.g. AppleScript) or has some kind of external API then you're not going to be able to do this.
简而言之:联系应用程序的开发人员,但不要抱太大希望。
不幸的是,在当今内存受保护的时代,我们或多或少必须满足于应用程序为我们提供的工作内容。
但是:您并非完全没有追索权。使用F-Script,您可能能够附加到进程并导致一些控制器或其他发出您可以捕获和记录的通知。
编辑:如果(看起来是这样)它是一个 Carbon 应用程序,那么您就完蛋了:
重新编辑:一个小小的aber;尽管不太可能,但您可以使用接口脚本实现某些目标,但还是有可能;我不会抱有希望。
In short: Contact the developer of the application, but don't get your hopes up.
Unfortunately, in this day and age of protected memory and whatnot, we more or less have to be content with what the applications give us to work with.
However: You are not entirely without recourse. Using F-Script you might be able to attach to the process and cause some controller or other to emit notifications that you can capture and log.
Edit: If, as appears to be the case, it's a Carbon application, you are well and truly hosed:
Reedit: One tiny little aber; it is possible, although unlikely, that you can achieve something using Interface Scripting, but again; I wouldn't get my hopes up.