Folder Action Script question

For some time I have been trying to get the following script working as a Folder Action (FA), but it’s very hit & miss. More missing than hitting.
However, I have noticed that when I go to re-configure the FA I have to re-enable Folder Actions when I right click on the folder. I’m not aware that I disable Folder Actions, but could that happen during standard system maintenance? I run MainMenu once or twice weekly & IceClean monthly.
All help gratefully received.
Simon


on adding folder items to thefolder after receiving theAddedItems
	
	repeat with eachitem in theAddedItems
		
		
		
		
		set theSender to "Simon<simon@xxx.xx.uk>"
		set recipCommon to "Documents"
		set recipAddress to "xxxxx@xxxxxxx.com"
		set msgText to ""
		
		
		tell application "Mail"
			
			
			set newmessage to make new outgoing message with properties {subject:"Important File Attachment: " & name of (info for eachitem), content:msgText & return & return}
			tell newmessage
				set visible to true
				set sender to theSender
				
				make new to recipient with properties {name:recipCommon, address:recipAddress}
				make new attachment with properties {file name:eachitem} at after the last paragraph
				
				
			end tell
			send newmessage
		end tell
		
		
	end repeat
	
end adding folder items to

Model: Mac Mini 1.66 GHz Intel Core Duo w/ 2GB RAM
AppleScript: 2.0.1
Browser: Firefox 3.0
Operating System: Mac OS X (10.5)

Why do you run them? They’re not standard maintenance, and since you’re having a problem with a script that looks like it should work, those are the fist things to suspect.

Hi,
You asked

Mainly because I can!
But you’re right so I’ve stopped running them, except for the Periodic Maintenance scripts, these I run because the computer is turned off at night.
Best wishes
Simon

Unless your computer is in your bedroom and would wake you up, you can set a schedule in the Energy Saver Preference Pane to wake your machine in the middle of the night for scheduled maintenance, and then go back to sleep, so you can leave your Mac on all the time. When it’s asleep it will spin down it’s disks, powerdown USB devices, sleep the cpu and turn off the screens.

It’s much cheaper (power consumption!) to use a 10$ tool like Macaroni and shut the computer off overnight :wink:

If you’re using Leopard, the maintenance scripts get run at startup if they were supposed to run the night before, so there is no need to run them again.