【问题标题】:Adium Applescript Growl NotificationAdium Applescript 咆哮通知
【发布时间】:2011-05-19 18:28:31
【问题描述】:

我正在编写一个脚本,每次联系人登录 Adium 时都会启动该脚本。 我的目标是在某些朋友登录时出现咆哮消息。 一切正常,除了我不知道如何从刚刚登录的联系人那里获取“显示名称”。

代码如下:

告诉应用程序“Adium”

#Get the alias of the contact that just signed on:
get display name of contact #most recently signed in (HOW DO I RESPRESENT THIS)


#Jon
if display name of contact is "Jon" then

    tell application "GrowlHelperApp"
        -- Make a list of all notification types:
        set the allNotificationsList to ¬
            {"Jon"}

        -- Make a list of the default enabled notifications:
        set the enabledNotificationsList to ¬
            {"Jon"}

        -- Register the script with Growl
        register as application ¬
            "AdiumFriends" all notifications allNotificationsList ¬
            default notifications enabledNotificationsList ¬
            icon of application "AdiumFriends"

        -- Send a notification:
        notify with name ¬
            "Jon" title ¬
            "Jon signed on" description ¬
            ¬
                "Facebook" application name "AdiumFriends"

    end tell
end if

说完

【问题讨论】:

    标签: applescript growl adium


    【解决方案1】:

    但是您可以在联系人登录时启动一个脚本。该脚本可以检查姓名,如果它与您想要的匹配,它会给您一个喊叫

    【讨论】:

      【解决方案2】:

      当有人登录时,似乎没有要挂钩的事件。实际上,Adium 根本没有暴露给 appleScript 的事件。如果您现在需要此功能,您可能必须维护已登录的成员列表,然后定期轮询。如果出现新的缺口,那将是咆哮的。这并不太难,但定期轮询需要一个可以在后台运行的 appleScript 应用程序,以及一个空闲事件,我敢肯定,这不是你想听到的。

      很抱歉没有更好的消息,但这是 appleScript 的一个相当典型的问题:您受 3rd 方应用程序开发人员的摆布,将有用的内容包含在字典中。很多时候他们没有,但只是感谢有一本字典!

      稍微好一点的消息是:Adium 和 Growl 都已经有了 appleScript 字典,而且都是开源的。 (Adium 是 GPL,Growl 是 BSD)。这意味着您有机会影响开发人员为 Adium 实现一些事件处理程序,但您也无法控制截止日期。您是否尝试过加入 Adium 开发者论坛?

      【讨论】:

        猜你喜欢
        • 2011-09-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-21
        • 2015-04-02
        • 1970-01-01
        • 1970-01-01
        • 2012-08-31
        相关资源
        最近更新 更多