我正在编写一个脚本,每次联系人登录 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
结束告诉