2009-08-17 13 views
0

Je suis en train de gronder de Ruby/Appscript, basé sur cet exemple de code AppleScript:d'Apple gestionnaire d'événements non (Ruby/AppScript) tout en essayant de gronder

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 

Mon code ressemble à ceci:

GH = app("GrowlHelperApp.app") 

enabledNotifications = "AppscriptMessage" 

GH.register(:as_application => "AppscriptHelper", 
    :all_notifications => enabledNotifications, 
    :default_notifications => enabledNotifications) 

le dernier appel échoue avec: Appscript::CommandError: CommandError OSERROR: -10000 MESSAGE: Apple event handler failed.

toutes les idées que je fais mal?

Répondre

0

D'Oh. Le enabledNotifications devrait être un tableau, pas seulement une chaîne.