I am an applescript newbie. What little I know is pieced together from example scripts, and I’m in a real pickle.
My ultimate goal is a folder action script that will change the icon of the folder it is attached to depending on whether or not it has anything in it. I gave up on the icon-switching part of this, creating Quicksilver command files that do the job, but I still can not make a basic script react.
My skeleton script is as follows:
on adding folder items to this_folder after receiving these_items
try
set theCount to the number of items in this_folder
if theCount is greater than 0 then
set alert_messege to "Wam!" as Unicode text
else
set alert_messege to "Nada" as Unicode text
end if
display dialog alert_messege
end try
end adding folder items to
I have no idea why this doesn’t work. The “set alert_message” lines will be replaced with a command to launch the icon changing files, but it doesn’t want to execute these commands. Thanks for your help.
Model: iBook G4
AppleScript: 1.10.7
Browser: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.4) Gecko/20070509 Camino/1.5
Operating System: Mac OS X (10.4)