Skip to content

Instantly share code, notes, and snippets.

@snaka
Created December 10, 2009 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snaka/253245 to your computer and use it in GitHub Desktop.
Save snaka/253245 to your computer and use it in GitHub Desktop.
VBScript Growl sample code (original by brian)
set growl = WScript.CreateObject("Growl.COM.Connector")
growl.ConfigureLocal "" ' you must call ConfigurLocal() or ConfigureRemote before .Register or .Notify will work
' create the sending app information
dim appName
appName = "VBScript Test"
set app = WScript.CreateObject("Growl.COM.Application")
app.Name = appName
' register
dim types(0)
set types(0) = WScript.CreateObject("Growl.COM.NotificationType")
with types(0)
.Name = "notify"
.DisplayName = "notify"
.Enabled = True
end with
growl.Register2 (app), (types) ' the extra () are required for some reason (related to COM Interop, but i am not sure why)
WScript.Sleep 500
' send notification
set n = WScript.CreateObject("Growl.COM.Notification")
with n
.ApplicationName = "VBScript Test"
.IconPath = "http://www.hatena.ne.jp/users/sn/snaka72/profile.gif"
.Title = "Notify test"
.Text = "test test test"
.Type = "notify"
end with
Set c = WScript.CreateObject("Growl.COM.CallbackContext") ' you can optionally set up a callback object as well
c.Url = "http://d.hatena.ne.jp/snaka72"
growl.Notify appName, (n), (c) ' the extra () are required for some reason (related to COM Interop, but i am not sure why)
WScript.Sleep 500
WScript.Echo("notification sent")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment