if (get name of every process) does not contain "iTunes" then set output to "iTunes is not active" else tell application "iTunes" if player state is not playing then set output to "iTunes is not playing" else set art to artist of current track as string set tra to name of current track as string set alb to album of current track as string set output to tra & " [" & alb & "] by " & art end if end tell end if end tell on error set output to "An unexpected error has occurred" end try
使用Growl提醒: set AppName to "AppleScript Growl" set NotifyName to "Everything"
on doRegister() --YOU NEED TO REGISTER FIRST! global AppName, NotifyName tell application "GrowlHelperApp" set the enabledNotificationsList to {NotifyName} register as application AppName all notifications enabledNotificationsList default notifications enabledNotificationsList end tell end doRegister
on doNotify(title, desc) global AppName, NotifyName set titleToNotify to title set descToNotify to desc tell application "GrowlHelperApp" notify application name AppName with name NotifyName title titleToNotify description descToNotify end tell end doNotify
on doNotifyWithIcon(title, desc, useapp) global AppName, NotifyName set titleToNotify to title set descToNotify to desc set iconToNotify to useapp tell application "GrowlHelperApp" notify application name AppName with name NotifyName title titleToNotify description descToNotify icon of application iconToNotify end tell end doNotifyWithIcon