You can use app name but if you do not put quotes around a string the it is seen as a variable.
If the variable is not declared before you try and access it/use it you will get an error.
This is what is happening to you. You can see this in the Consol.app
18/08/2013 11:46:11.961 Growl[89225]: completion error: Error Domain=NSPOSIXErrorDomain Code=2 "The operation couldn’t be completed.... .../Library/Application Scripts/com.Growl.GrowlHelperApp/Rules.scpt: execution error: The variable Dropbox is not defined. (-2753) }
Putting the string Dropbox in quotes will fix this.
Here is a working test I used.
using terms from application "Growl"
on evaluate notification with notification
if notification's app name contains "Image File" then
if notification's note title contains "jpeg Error" then
do shell script "echo " & quoted form of note type of notification & " > ~/notification.txt "
end if
end if
if notification's app name is "Dropbox" then
if notification's note title contains "cb" then
set the_file to ("cb.txt") as string
set the_text to (do shell script "cat ~/Dropbox/" & quoted form of the_file)
set the clipboard to the_text
do shell script "echo " & quoted form of the_text & " > ~/dbnotification.txt "
end if
end if
end evaluate notification
end using terms from
This also shows you how to test for different rules
NOTE** Normally I would get the users home folder with:
set homePath to (path to home folder from user domain) as text
But there seems to be a bug in growl that returns a growl folder
com.Growl.GrowlHelperApp/Rules.scpt: execution error: cat: /Users/USERNAME/Library/Containers/com.Growl.GrowlHelperApp/Data/Dropbox/cb.txt: No such file or directory (1)