【问题标题】:Set status in iChat by iChatAgent programmatically通过 iChatAgent 以编程方式在 iChat 中设置状态
【发布时间】:2012-03-02 15:56:53
【问题描述】:

我的应用程序使用 AppleScript 根据用户的热键更改 iChat 中的状态。一切正常,但在 iChat 没有运行的情况下,我有一个“iChatAgent”正在运行,它的图标在状态栏中;我的 Dock 中没有 iChat 的图标。

所以在这种情况下,如果我的应用程序发送 AppleScript 命令来更改 iChat 状态 (tell application "iChat" set status blah-blah...),它会自动激活 iChat,并且 iChat 图标会出现在 Dock 中。我不想激活 iChat。我不需要对我的 Dock 进行任何更改。但是我需要在 iChat 不运行时更改它的状态。

如何通过我向 iChatAgent 的申请来更改状态?有可能吗?

【问题讨论】:

    标签: applescript ichat


    【解决方案1】:

    iChatAgent 是 iChat 本身未运行时 iChat 5 使用的后台消息传递应用程序。在安装了 FaceTime 的 Snow Leopard 和 Lion 上,它已被 IMAgent 取代(/System/Library/PrivateFrameworks/IMCore.framework/imagent.app/ - 请参阅 this Apple Support Communities discussion thread 以获得证实)。

    代理不支持 AppleScript,您可以通过尝试将其添加到 AppleScript 编辑器字典面板自行检查:您将收到一条错误消息,指示应用程序不可编写脚本。这意味着脚本只能针对 iChat 本身,并且通过扩展,当您这样做时,您无法绕过应用程序启动(这也适用于 iChat 中的脚本插件——它们仅在应用程序运行时触发)。

    TL;DR:如果不启动 iChat.app,您将无法通过 AppleScript 设置 iChat 状态

    【讨论】:

    • 我是这么认为的...感谢您确认我的假设!很好的答案!
    猜你喜欢
    • 2018-02-17
    • 1970-01-01
    • 2011-07-04
    • 1970-01-01
    • 2013-07-10
    • 2023-04-09
    • 2012-06-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多