【问题标题】:Sending iMessage from Mac从 Mac 发送 iMessage
【发布时间】:2014-04-14 15:25:10
【问题描述】:

Mac 应用程序是否可以调用消息应用程序向特定联系人或电话号码发送消息?我发现的唯一可能的线索是 IMService 框架,但这似乎在 10.9 Mavericks 中已被弃用。

【问题讨论】:

  • 您研究过 AppleScript 解决方案吗?消息可能会暴露某种 AS 接口

标签: macos cocoa messages imessage ichat


【解决方案1】:

一种可能的方法是使用Apple Script 通过消息应用程序发送消息。

请参阅此问题以获取示例:
How to send a message using iChat and AppleScript

【讨论】:

  • 谢谢。该脚本可自行运行,但在使用 NSAppleScript 从另一个应用程序调用时则无法运行。我在控制台中收到一条消息:“执行脚本时出错。错误 { NSAppleScriptErrorAppName = Messages; NSAppleScriptErrorBriefMessage = “发生了权限违规。”; NSAppleScriptErrorMessage = “消息出现错误:发生了权限违规。”; NSAppleScriptErrorNumber = “-10004 "; NSAppleScriptErrorRange = "NSRange: {110, 41}"; }"
  • 你的应用是沙盒的吗?
  • 它是沙盒的。我已按照有关添加相关权利的一些说明进行操作,但它仍然不起作用。特别是在 com.apple.security.scripting-targets 中,我添加了: com.apple.iChatcom.apple.ichat.applescript
猜你喜欢
  • 2019-03-31
  • 2018-08-09
  • 2017-12-04
  • 2012-11-16
  • 1970-01-01
  • 2013-04-04
  • 1970-01-01
  • 1970-01-01
  • 2012-06-06
相关资源
最近更新 更多