Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Permanently delete files via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Permanently delete files via AppleScript
Authored by: gshenaut on Nov 30, '07 10:17:03AM

For a simpler--but equally dangerous--method of removing files, use an Automator Finder plug-in. I have one I call "Expunge", with two actions. The first action is an Automator "Ask for confirmation" screen, and the second one is a simple "Run shell script" that takes the selected files as command line arguments, and applies "rm -rfP" to each one, in a for loop. I save this workflow as a Finder plugin, and voilĂ . When you control-click on one or more objects in the Finder, you just slide down to the "Automator" submenu and select Expunge to delete them immediately and permanently.



[ Reply to This | # ]
Permanently delete files via AppleScript
Authored by: V.K. on Dec 05, '07 04:47:30PM

here is a variation of the above to delete all files in a folder.
Make an automator action consisting of the following simple shell script:

for f in "$@"
do
rm "$f"/*
done



Save the automator action as a finder plug-in and there you have it.
Right-clicking on a folder and choosing your plug-in from the contextual menu will delete all the files in that folder. As Rob says be careful using this!



[ Reply to This | # ]