run away folder action

I am working on a folder action script that uploads files to an FTP site using UNIX. I am building in a routine that checks to make sure the FTP site is up and ready for files before the script starts processing the files (see below).

Assuming there may be times that the FTP site is down for a periond, I put in a loop script to wait for the FTP site to come back up. While testing (using a known bad ftp address) I created a run away folder action. Now that the script is in this loop, I have no way of killing the folder action script, although I can see it is still writing to my log. I tried disabling and re-enabling Folder action scripts, but that does not kill the looping script.

Any suggestions?

Does anyone know how folder action scripts are named in Activity Viewer/Top?

on adding folder items to this_folder after receiving these_items
set log_path to "~"
set log_name to "loop.txt"

	set testresult to "x"
	set testcommand to "curl " & ftpSite & " --user " & ftpUser & ":" & ftpPass & " --connect-timeout 3 --head --quote -quit"
	--display dialog "" default answer testcommand
	repeat while testresult is not ""
			set testresult to (do shell script testcommand)
			set testresult to ""
		on error error_message number error_number
			set log_entry to "FTP ERROR: " & error_message & " " & error_number & " retrying in 3 minutes - files will queue up"
			logger(log_entry, log_path, log_name)
			set testresult to "x"
		end try
		delay 8 -- set to 180 for production

	end repeat

-- commands to process files

end adding folder items to
on logger(log_entry, log_path, log_name)
	set log_entry to short date string of (current date) & " " & time string of (current date) & " " & log_entry
	set logCmd to "echo " & (quoted form of log_entry) & " >> " & (quoted form of (log_path & log_name))
	do shell script logCmd
end logger

Try quitting the Finder.

quitting the finder did not kill the script.

Killing System Events will stop the script.