(* Author: Jayson Kempinger E-mail: evilglowingapple@gmail.com Date created: 23 April 2005 Permantly Shred script Drop files/folders onto this as an application. This script will shred the files using the command specified in property command. Icon modified from origional e.shred.gif at http://www.lebofsky.com/write/hailstorms.html *) --command to shred files. Use shred if you have it installed, use "rm -rfP " if you do not property command : "rm -rfP " --when running the app not as a dropplet, shred the files in the current user's trash on run set x to display dialog "Do you want to permanently shred (delete by overwriting) all the files in your trash?" buttons {"Yes", "No"} default button "No" if button returned of x is "Yes" then try do shell script command & "~/.Trash/*" end try --update trash icon in the dock tell application "Finder" to update trash end if end run --shred dropped files on open of target_files --combine filenames of all files into one string for subject set n to 1 set filenames to "" set filelist to {return} repeat until n is the ((length of target_files) + 1) set n_file to item n of target_files if n is less than (length of target_files) then --set filenames for command and filelist for dialog prompt set filenames to filenames & "\"" & POSIX path of n_file & "\" " set filelist to filelist & POSIX path of n_file & {return} else --set filenames for command and filelist for dialog prompt set filenames to filenames & "\"" & POSIX path of n_file & "\"" set filelist to filelist & POSIX path of n_file end if set n to n + 1 end repeat set x to display dialog "Do you want to permanently shred (delete by overwriting):" & filelist & "?" buttons {"Yes", "No"} default button "No" if button returned of x is "Yes" then try do shell script command & filenames end try --update trash icon in the dock just in case files were from the trash folder tell application "Finder" to update trash end if end open