Page 2 of 2

Posted: Mon Aug 27, 2007 4:34 am
by soj
I've looked at http://growl.info/documentation/ and http://trac.growl.info/trac/ticket/324 ... not finding what you're describing.

Posted: Mon Aug 27, 2007 1:54 pm
by The_Tick
Click on developer docs...

Posted: Wed Aug 29, 2007 7:26 am
by soj
Do I need to add this code anywhere and if so where?

Posted: Wed Aug 29, 2007 9:06 pm
by The_Tick
I don't get your question. Please be verbose.

Posted: Thu Aug 30, 2007 10:30 am
by DeltaTee
A while back I wrote a generic notification wrapper that will use growl if it is available, or a dialog if it is not. The code is not really pretty (and incredibly long). If anyone is interested in using the code, let me know. The important thing to note is that you can't use the name of the application in a tell block if the application does not exist on the system. The code ends up looking something like:

Code: Select all

try -- to get a reference to growl
	tell application "Finder" to set growlHelperApplication to name of application file id "com.Growl.GrowlHelperApp" as string
	--tell application "System Events" to set GrowlExists to exists application process ("GrowlHelperApp" as string)
	set GrowlExists to true
on error -- Growl is not installed
	set GrowlExists to false
end try

using terms from application "GrowlHelperApp"
	tell application growlHelperApplication to notify title |title| description msg application name _appName with name (_scriptName & " " & notification)
end using terms from
I ended up using the file id because this should always work--even if growl is not currently running.

Posted: Fri Aug 31, 2007 7:35 am
by soj
You said:
The_Tick wrote:Hey nanovivid. When you guys get this figured out, can you add this and http://trac.growl.info/trac/ticket/324 to the applescript docs?
Where the h*** do we add the code to?

Posted: Thu Nov 22, 2007 12:33 am
by bellac
I realize that this is an old thread, but here's how I do it (and it's easily tested by turning Growl off in the preference pane):

Code: Select all

tell application "System Events" to set GrowlRunning to exists application process "GrowlHelperApp"
set Message to "So this message appears in Growl"
set altMsg to "GrowlHelperApp is not running"
Notify(Message, altMsg, GrowlRunning)

on Notify(msg, altMsg, Growler)
	if Growler then
		tell application "GrowlHelperApp"
			register as application "NoteTester.scpt" all notifications {"Note"} default notifications {"Note"} icon of application "Script Editor"
			
			notify with name "Note" title "GrowlHelperApp is Running" description msg application name "NoteTester.scpt"
		end tell
	else
		display dialog altMsg
	end if
end Notify