|
|
Pick a file to shred (on run)
Using a file selection dialog, ... if some files in the trash cause too much angst, pick them :)
---------- (* 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 -- some modifications by Dan Shockley (http://www.danshockley.com) -- some more modifications by dbingham -- minor addition by rshrinivas *) --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 a user selected file on run set x to choose file with prompt "Pick a file to shred" --default value "~/.Trash/" set fileName to " \"" & POSIX path of x & "\" " set x to display dialog "Confirm deleting " & fileName & "?" buttons {"Yes", "No"} default button "No" if button returned of x is "Yes" then try do shell script command & fileName end try --update finder tell application "Finder" to update end if end run --shred dropped files on open target_files --combine filePaths of all files into one string for subject set filePaths to "" -- space-separated list of file-paths for the shell command set fileVerticalList to "" -- retrn-delimited list of file-paths for dialog prompt repeat with n_file in target_files set n_file to contents of n_file -- sometimes a "reference" is not a good thing, so -- let's explicitly set n_file to the if n_file is last item of target_files then set fileVerticalList to fileVerticalList & POSIX path of n_file set filePaths to filePaths & quoted form of POSIX path of n_file else set fileVerticalList to fileVerticalList & POSIX path of n_file & return set filePaths to filePaths & quoted form of POSIX path of n_file & space end if end repeat set x to display dialog "Do you want to permanently shred (delete by overwriting):" & return & fileVerticalList & "?" buttons {"Yes", "No"} default button "No" if button returned of x is "Yes" then try do shell script command & filePaths 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 |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|