Can script delete itself on ending

Does any one know if a script can delete itself once it has finish doing what it does. I want to run a script and then have the file that I ran delete itself.

Daniel

You can have the script move its file to the trash:


set f to path to me

tell application "Finder"
	
	-- delete item f --> caused an error about the file being open
	
	move item f to trash -- this worked
	
end tell

I never thought of that

Thanks for your solution