Apple 事件处理程序在尝试咆哮时失败
我正在尝试从 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 事件处理程序失败。
有什么想法我做错了吗?
I'm trying to growl from Ruby/Appscript, based on this sample Applescript code:
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
My code looks like this:
GH = app("GrowlHelperApp.app")
enabledNotifications = "AppscriptMessage"
GH.register(:as_application => "AppscriptHelper",
:all_notifications => enabledNotifications,
:default_notifications => enabledNotifications)
the last call fails with:
Appscript::CommandError: CommandError OSERROR: -10000 MESSAGE: Apple event handler failed.
any ideas what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哦。 enabledNotifications 应该是一个数组,而不仅仅是一个字符串。
D'Oh. The enabledNotifications should be an Array, not just a string.