Created
December 10, 2009 09:51
-
-
Save snaka/253245 to your computer and use it in GitHub Desktop.
VBScript Growl sample code (original by brian)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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