here is the like for more info.
h**p://growl.info/
Regards, Robb

Moderators: Mr_Noodle, Moderators
property programName : "Hazel"
global notifysys
set notifysys to "growl"
(* you only need to run init once. once you register an app with growl, it stays. in case you give the script to someone else, or you reinstall your system, whatever, the following checks that "Hazel" is registered with growl, and if it isn't, runs init.
Every registered app has a .growlticket file in the Tickets folder, so I have Finder searching for Hazel's growlticket.*)
tell application "Finder"
-- is growl running?
if (name of processes) contains "GrowlHelperApp" then
-- if "hazel" hasn't been registered with growl, run init to do so
if not (exists file "Hazel.growlTicket" of folder "Tickets" of folder "Growl" of (path to application support from user domain)) then my init()
else
-- if growl isn't running, resort to dialogs
set notifysys to "dialog"
end if
end tell
on notify(ntype, ntitle, ntext)
if notifysys is "growl" then
tell application "GrowlHelperApp"
notify with name ntype title ntitle description ntext application name programName
end tell
else
(* this gets annoying. you'll be working in another program and finder will come to the front to let you know the file has moved. you can take out the "activate" line, but then the finder icon is going to jump in the dock until you switch and acknowledge the dialog (yes, even though it's supposed to give up after 4 secs). personally, i'd suggest giving up the dialog notifications. *)
tell application "Finder"
activate
-- YOU NEED TO DESIGNATE THE WHERE THE HAZELHELPER ICONS CAN BE FOUND. I used icons2icns to get the icons from the HazelHelper app and save it to a icns file. You can save the script as a bundle, if you want, and put the icns file in the bundle. But again, the dialogs are a pain in the butt, so I'd forego all that if I were you.
display dialog ntext buttons ("Okay") default button 1 with title ntitle with icon alias "R2D2:Users:me:Desktop:HazelHelper.icns" giving up after 4
end tell
end if
end notify
on init()
tell application "GrowlHelperApp"
set allNotificationsList to {"Items Labeled", "Items Moved", "Items Trashed"}
register as application programName all notifications allNotificationsList default notifications allNotificationsList icon of application "HazelHelper.app"
end tell
end init
on hazelProcessFile(theFile)
-- change file designations as necessary
set pathToScript to (path to desktop as string) & "mainscript.scpt"
set GrowlNotify to (load script file pathToScript)
(* this tell block isn't necessary. you can delete it and stick with the generic "Item has been moved"*)
tell application "Finder" to set theFileName to name of theFile as string
tell GrowlNotify
run
notify("Items Moved", "Items Moved", theFileName & " has been moved.")
end tell
end hazelProcessFile
tell application "Finder"
set growlLoc to "PreferencePanes:Growl.prefpane"
-- where is growl? in computer library folder or user library folder? wherever the hell it is, open it (& start it)
if exists file ((path to library folder from local domain as string) & growlLoc) then
open file ((path to library folder from local domain as string) & growlLoc)
else
if exists file ((path to library folder from user domain as string) & growlLoc) then open file ((path to library folder from user domain as string) & growlLoc)
end if
end tell