a secure delete droplet
a secure delete droplet
- Subject: a secure delete droplet
- From: roy whelden <email@hidden>
- Date: Sun, 9 Mar 2003 15:46:03 -0800
Since many of us now live under a repressive 1984-like surveillance (in
America, thanks to John Ashcroft and his incredibly wrong-headed
Patriot Act) I offer this tiny AppleScript droplet, which I call
"Annihilate," whose sole function is to thoroughly erase, so that all
traces are gone, any file or folder dropped on it. Please improve it,
if you can, and distribute it to all who might find it useful. I myself
keep it permanently on the dock. I welcome any feedback from list
members.
Roy Whelden
-------------------------------------------
on open theFiles
--if the user dropped a single file and if that file is a folder,
inform him that everything in folder is doomed for extinction
set l to the length of theFiles
repeat with i from 1 to l
set inf to get info for item l of theFiles
if folder of inf = true and l = 1 then
display dialog "This folder and everything in it will be deleted."
exit repeat
end if
if folder of inf = true then
display dialog "You have asked that a folder be securely deleted. Be
aware that everything contained in this folder will also be deleted."
exit repeat
else
set i to i + 1
end if
--after all files to be deleted here have been checked for folderhood
if i = l + 1 and i = 2 then
display dialog "The (" & l & ")" & " file dropped here will be
securely deleted now."
exit repeat
else
display dialog "The (" & l & ")" & " files dropped here will be
securely deleted now."
exit repeat
end if
end repeat
set i to 0 --variable to keep track of successful deletions
set e to 0 --variable to keep track of unsuccessful deletions
--securely delete each of the items in theFiles
repeat with x in theFiles
try
set target to POSIX path of x
do shell script "rm -Prf -- " & quoted form of target --"'" & target
& "'"
set i to i + 1
on error
set e to e + 1
end try
end repeat
--sometimes the icons of deleted files don't disappear immediately
tell application "Finder" to update desktop
--inform the user of any failure
if e b 0 then
display dialog "Number of items to be securely deleted: " & l &
return & "Number of items securely deleted: " & i B,
& return & "Number of items not deleted: " & (l - i) giving up after
5
else
beep
display dialog "All were successfully deleted." giving up after 2
end if
end open
--------------------------------------------
"Surely, it is the sheer hypnosis of numbers that drives the arms race
ever onward. Who but a numberskull could care more about megatons than
about radiation sickness?" -- Rudy Rucker, mathematician and writer
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.