Skype Mac API - 使用 AppleScript 还是 5 年前的 API?
我有一个 x86_64 应用程序,我希望可以选择读取 Skype 状态消息。然而,已有 5 年历史的 Skype mac 框架是 32 位的,如果有办法在 64 位应用程序中编译该框架,我还没有找到。
我的问题基本上是,我应该如何去做呢?我实际上只需要获取和设置 USERSTATUS AWAY/ONLINE 字符串。
使用 AppleScript,每次都会弹出“Skype 是否应该允许此操作”对话框。这是非常低效且令人恼火的。
建议?
我正在考虑编写一个 32 位 CLI 包装器,但这似乎有点矫枉过正。
I have a x86_64 app that I would like to have optionally read Skype status messages. However, the 5 year old skype mac framework is 32-bit, and if there is a way to have that compile within a 64-bit app, I haven't found it.
My question is, basically, how should I go about doing this? I really only need to get and set the USERSTATUS AWAY/ONLINE string.
Using AppleScript, a "Should Skype allow this" dialog pops up... every time. This is highly inefficient and downright irritating.
Advice?
I'm considering writing a 32-bit CLI wrapper, but that seems like overkill.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我使用通知观察器了解到 Skype 的 API 只能与 NSDistributedNotifications 配合使用。对于 64 位应用程序来说,重复这些通知就像一个魅力。
I used Notification Watcher to learn that Skype's API just works with NSDistributedNotifications. Repeating those notifications worked like a charm for a 64bit app.
查看 Scripting Bridge:脚本桥编程简介可可指南
Check out Scripting Bridge: Introduction to Scripting Bridge Programming Guide for Cocoa
如果我没记错的话,一旦您允许权限,权限对话框就不会出现。
我的 Skype Apple 脚本必须通过 GUI 才能单击它们。如果他们上来的话。
If I remember right, the permission dialog does not come up once you allow permission.
I my Skype Apple Scripts I have to GUI to click them. If they come up.
我发现如果您通过查看捆绑内容打开“Skype.app”->您将找到 64 位和 32 位的框架 skype.framework
I've found out that if you open "Skype.app" by viewing bundle contents -> Frameworks you'll find a 64bit and 32bit skype.framework
这是针对 Twitter 请求的回复。我很久以前问过这个问题后就使用了这段代码。我不需要研究 Skype API,因为它工作得很好,但我想自从我上次尝试使用它以来它已经更新了。无论如何...
这是我与 Skype 通信时使用的 NSDistributedNotifications 列表:
就像任何其他类型的 NSDistributedNotification 一样,您只需注册并处理结果:
这些是我与 Skype 保持同步的 iVar:
这是如何连接到 Skype 的示例:
这是获取状态的示例消息(在您注册 Skype 后):
This is an answer in reply to a request from twitter. I used this code after asking this question way back when. I have not needed to look into the Skype API since this works just fine, but I imagine that its been updated since I last tried to use it. Anyhow...
Here's a list of the NSDistributedNotifications that I use when communicating to skype:
Just like any other kind of NSDistributedNotification, you simply register and process the results:
These are the iVars that I keep to sync with Skype:
Here's an example of how to connect to skype:
Here's an example of getting the status message (after you've registered with Skype):