Search code examples
macosapplescriptautomatorgrowl

Set text of a Growl Notification using Automator?


I have an Automator Application containing the action "Show Growl Notification", which is always empty when it appears. I've tried using the "Get Specified Text" and "Get Value Of Variable" actions directly before it, but nothing I've tried seems to work.


Solution

  • The code sample from gadgetmo is almost correct but won't work as is with Growl 1.4

    An application must be registered and enabled and must provide a list of notifications it will present and also a list of which of those notifications are enabled.

    You can skip all that config stuff if you just hijack the preconfigured automator settings as shown below.

    Key points to note are "Automator notification" as the name of the notification and "Automator" as the source application.

    tell application "System Events"
        set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
    end tell
    
    if isRunning then
        tell application id "com.Growl.GrowlHelperApp"
            notify with name ¬
                "Automator notification" title ¬
                "Processing Files" description ¬
                input as text application name "Automator"
        end tell
    end if