Page 1 of 1

activating GrowlHelperApp in AppleScript

Posted: Thu Mar 06, 2008 2:55 pm
by Wooden Brain Concepts
I'm having trouble predictably activating GrowlHelperApp in an AppleScript if Growl is not running.

The problem is although a register/notify calls shows Growl goes from "stopped" status to "running" status in the preference pane, the GrowlHelperApp application does not appear to actually launch. It does not show up in the processes. Then I get the error "connection is invalid" which I have trapped below.

I am using Growl 1.1.3b3 on Tiger 10.4.11.

Here's what I'm doing.

If the system events processes do not contain "GrowlHelperApp" then I want to loop (with a 5 second delay) until it does. In the loop I'm using:

Code: Select all

tell application "System Events" to set theprocs to the name of every process 
repeat while theprocs does not contain "GrowlHelperApp"
				try
					using terms from application "GrowlHelperApp"
						tell application "GrowlHelperApp"
							register as application appName all notifications myAllNotesList default notifications mydefNotesList
							notify with name "Status Message" title "Looking for Growl" description "..." application name appName
						end tell
					end using terms from
				on error errmsg
					log errmsg
				end try
delay 5
tell application "System Events" to set theprocs to the name of every process 
end repeat
[/code]