Folder Action Setup removing entries for deleted scripts

Hi,
I’m creating and managing Watched Folders, and everything works fine apart from one problem. If the user has deleted the watched folder and emptied Trash (name shows up in red in the F A S list) I don’t seem to be able to remove it.
Relevant bit of code is:


repeat with foo in every folder action
...
tell application "System Events"
	set bar to every script of foo--just in case
	repeat with ba in bar
		set enabled of ba to false
		set enabled of foo to false
		try--so that the missing folder doesn't stop the script
			set myAction to remove action from ((path of foo) as alias) using action name (name of ba)
		end try
	end repeat
end tell
...

I of course can remove the red items manually.

Anyone played with this of have any suggestions?

thanks
rhb

Duh!

Sussed it meself di’n’n’i:


delete (every folder action where name is (name of thisFolderAction))

:slight_smile: