Turns out this is super easy and can be implemented with any version of Smedge.
Growl has the ability to send notifications using AppleScript. Smedge can then start the AppleScript using the Herald component. A simple AppleScript like this should cover most of your needs:
on run argv
tell application "GrowlHelperApp"
-- Register Smedge with Growl
set the allList to {"Smedge Notification"}
set the enabledList to {"Smedge Notification"}
register as application "Smedge" all notifications allList default notifications enabledList icon of application "Smedge"
-- Get the message info from the command line that started this script
if the number of items in argv < 1 then
set the notificationTitle to "Error"
set the notificationMsg to "The script was called with no parameters. You must supply at least the message to display, and optionally the title of the notification"
else if the number of items in argv < 2 then
set the notificationTitle to "Smedge Notification"
set the notificationMsg to item 1 of argv
else
set the notificationTitle to item 1 of argv
set the notificationMsg to item 2 of argv
end if
-- Send the notification
notify with name "Smedge Notification" title notificationTitle description notificationMsg application name "Smedge"
end tell
end run |
Save this script somewhere on your system. Then, create a Herald event to respond to the event you are interested in. The action should be Execute a Command. The command should be something like this:
osascript /path/to/script.scpt "Title of message" "Text of message" |
You can use Smedge variables in either of the message strings, and you can optionally leave off the title of the message (it will use "Smedge Notification" by default). For example, this may be a useful script for a Job Finished Event:
| osascript /path/to/script.scpt "Job $(Name) Finished" |
Edited by author on Fri, 30/Sep/2011 4:33 PM |