macosgrowlgrowlnotify

How to put growl notification using applescript?


I am using a script which updates my working copy of SVN.

I've installed Growl. I want to put Growl notifications once my script finishes updating my working copy of SVN.

Please help me.


Solution

  • Little bit of searching on Google and in Growl's site could have solved your problem.

    Click here to know about it.

    Or directly copy paste this code in your apple script editor and see how it works.

    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"
            -- Make a list of all the notification types 
            -- that this script will ever send:
            set the allNotificationsList to ¬
                {"Test Notification", "Another Test Notification"}
    
            -- Make a list of the notifications 
            -- that will be enabled by default.      
            -- Those not enabled by default can be enabled later 
            -- in the 'Applications' tab of the Growl preferences.
            set the enabledNotificationsList to ¬
                {"Test Notification"}
    
            -- Register our script with growl.
            -- You can optionally (as here) set a default icon 
            -- for this script's notifications.
            register as application ¬
                "Growl AppleScript Sample" all notifications allNotificationsList ¬
                default notifications enabledNotificationsList ¬
                icon of application "Script Editor"
    
            --       Send a Notification...
            notify with name ¬
                "Test Notification" title ¬
                "Test Notification" description ¬
                "This is a test AppleScript notification." application name "Growl AppleScript Sample"
    
            notify with name ¬
                "Another Test Notification" title ¬
                "Another Test Notification :) " description ¬
                "Alas — you won't see me until you enable me..." application name "Growl AppleScript Sample"
    
        end tell
    end if
    

    I hope this should solve your question.