連絡先が 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
終わりを告げる