0

連絡先が 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

終わりを告げる

4

2 に答える 2

1

ただし、連絡先がログインしたときにスクリプトを開始できます。そのスクリプトは名前をチェックし、それが希望と一致する場合は叫び声を上げます

于 2012-02-07T15:26:28.030 に答える
0

誰かがサインインしたときにフックするイベントがないようです。実際、Adium には、appleScript に公開されるイベントはまったくありません。この機能が今必要な場合は、サインインしているメンバーのリストを維持し、定期的にポーリングする必要があります。新しいニックネームが表示された場合、それについてうなり声を上げます。これはそれほど難しいことではありませんが、定期的なポーリングには、バックグラウンドで実行できる AppleScript アプリと、聞きたくないアイドル イベントが必要です。

良いニュースがなくて申し訳ありませんが、これは AppleScript のかなり典型的な問題です: 辞書に有用なものを含めることは、サードパーティのアプリ開発者のなすがままです。多くの場合、そうではありませんが、辞書があることに感謝してください。

Adium と Growl には既に AppleScript 辞書があり、どちらもオープン ソースです。(Adium は GPL、Growl は BSD)。つまり、開発者に影響を与えて Adium 用のイベント ハンドラーを実装する可能性はありますが、期限を設定することはできません。Adium 開発者フォーラムに参加してみましたか?

于 2011-05-25T19:11:59.770 に答える