我正试图从Ruby / Appscript中咆哮,基于这个示例Applescript代码:
tell application "GrowlHelperApp"
set the enabledNotificationsList to {"Mail Notification"}
register as application "MailWidgetGrowlHelper" all notifications enabledNotificationsList default notifications enabledNotificationsList icon of application "Mail.app"
notify with name "Mail Notification" title (item 1 of argv) description (item 2 of argv) & return & return & (item 3 of argv) application name "MailWidgetGrowlHelper" icon of application "Mail.app" without sticky
end tell
我的代码如下所示:
GH = app("GrowlHelperApp.app")
enabledNotifications = "AppscriptMessage"
GH.register(:as_application => "AppscriptHelper",
:all_notifications => enabledNotifications,
:default_notifications => enabledNotifications)
最后一次通话失败:Appscript::CommandError: CommandError OSERROR: -10000 MESSAGE: Apple event handler failed.
任何想法我做错了什么?
答案 0 :(得分:0)
D'喔。 enabledNotifications应该是一个数组,而不仅仅是一个字符串。