WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Growl Notify UDF

 Keywords: growl notify growlnotify growlnotify.exe send SendGrowl 

;Only messagetext is required. All other parmaters will use default values if left blank.
;MessageText          The notification's text - Required
;GrowlPath            Path to growlnotify.exe - Default is where the script is being run from
;Title                The notification title. - Default: "growlnotify"
;Sticky               Indicates if the notification should be sticky. Valid values: true|false Default: false
;Priority             The notification priority. Valid values: -2|-1|0|1|2 Default: 0
;Host                 The host address to send the notification to.   Default: localhost
;Pass                 The password required to send notifications. Default: no password
;Application          The name of the application sending the notification. The application must already be registered unless the Register parameter is used. Default: growlnotify
;Register             Register the application first. Default: application not automatically registered comma-separated list of the notification types to register. Examples: "Some Notification" | "Notification One","Notification Two","Notification Three"
;type                 The notification name/type. Default: "General Notification"
;img                  The icon to show for the notification. Must be a valid file type (png, jpg, gif, ico).
;callbackurl          A callback url (will be opened if the notification is clicked). Default: no callback

;For full explanation , usage and a link to download growlnotify see: http://www.growlforwindows.com/gfw/help/growlnotify.aspx

#DefineFunction SendGrowl(MessageText,GrowlPath,Title,Sticky,Priority,Host,Pass,Application,Register,type,img,callbackurl)
   If GrowlPath == "" Then GrowlPath = FilePath(IntControl(1004,0,0,0,0)) : "growlnotify.exe"
   MessageText='messagetext:"' : StrReplace(MessageText,@CRLF,"\n") : '"'
   If Title != "" Then Title = '/t:"' : StrReplace(Title,@CRLF,"\n") : '"'
   If Sticky != "" Then Sticky = "/s:" : Sticky
   If priority != "" Then priority = "/p:" : priority
   If Host != "" Then Host = "/host:" : Host
   If Pass != "" Then Pass = "/pass:" : pass
   If Application != "" Then Application = '/a:"' : Application : '"'
   If Register != "" Then Register = '/r:"' : Register : '"'
   If type != "" Then Type = '/n:"' : Type : '"'
   If img != "" Then  img = '/i:"' : img : '"'
   If callbackurl != "" Then callbackurl = '/cu:"' : callbackurl : '"'
   cmdline=MessageText : " " :  Title : " " :  Sticky : " " :  Priority : " " :  Host : " " :  Pass : " " :  Application : " " :  Register : " " : type : " " : img : " " : callbackurl
   Run(GrowlPath,cmdline)
#EndSubRoutine

;Tests
SendGrowl("This is a line of text." : @CRLF : "This is the Next Line","","This is My title","true","","","","My Test Application","Notification,Audit","Notification","C:\Program Files\WinBatch\Icons\BIGOWL2.ico","")
SendGrowl("This test does not use any other params","","","","","","","","","","","")
SendGrowl("Link to Winbatch",""

Article ID:   W18248
Filename:   Growl Notify  UDF.txt
File Created: 2009:09:04:12:09:38
Last Updated: 2009:09:04:12:09:38