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

10.4: Install an Automator action to delete files System 10.4
Tiger only hintOne of the holes in Automator's action lineup is an action which will delete files -- not move them to the trash, but actually delete them altogether. So I decided to write an action that does just that.

Delete Files.action is an open source (Lesser GPL licensed) program that provides an Automator action that shows up in the Finder entry in the Library column, and accepts "Files/Folders" as input. One can select from four delete types (simple unlink, 1-pass wipe, 7-pass wipe, 35-pass wipe), can instruct it to ignore errors, and can customize the optional confirmation dialog.

The action is free to use; feel free to comment on it here or drop me an email...

[robg adds: I tested this out, and it works as described. After installing the new action, you'll find a folder on your desktop with three Automator plug-ins for the Finder. Drag some/all of them to you user's Library -> Workflows -> Applications -> Finder folder, and you'll have them available in the Finder's Automator contextual menu. This code is also a great way to see how to create an Automator action of your own, as the source is included, so you can take a look at the AppleScript that drives the action.]
  • Currently 3.20 / 5
  You rated: 4 / 5 (5 votes cast)

10.4: Install an Automator action to delete files | 5 comments | Create New Account
Click here to return to the '10.4: Install an Automator action to delete files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Another warning about Burn folders & iPhoto
Authored by: eboss on Sep 15, '05 10:42:16AM

I've also started to use burn folders a few days ago. I've noticed a strange behavour with iPhoto.

When you drag an item from Finder to a Burn folder, it creates an alias, OK, but when you drag a photo (or group of photos) from iPhotos to a Burn folder, it copies them instead of creating an alias.
It's very disappointing because I wanted to make a CD with a selection of photos all at the root level of the CD (so I couldn't use the "burn" function of iPhoto) but I didn't want to copy them on the finder bacause I had a disk space problem.

I don't know if it is a bug or a feature ;-) but it's annoying !

[ Reply to This | # ]
about Burn folders & DVD
Authored by: morespace54 on Sep 15, '05 12:14:52PM

I dont know but it seems that my "burn" folders wont get burned if they exceed 650/700 MB... So what should I do if I want to burn my folder on a DVD?

[ Reply to This | # ]
Dangerous script
Authored by: mzs on Sep 15, '05 11:29:58AM
I do not have 10.4 to try automator, but I think this script has a problem.

Run this command on your system:

osascript -e 'POSIX path of "; rm -rf $HOME"'
Does that give you a hint of what may be wrong with these lines inside 'Delete Files/main.applescript':

                        tell application "Finder"
                                set pospath to (POSIX path of f)
                                set p to ("\"" & pospath & "\"")
                        end tell
                        set cmd to rmcmd & " " & p
                        -- display alert "command: " & cmd
                        do shell script (cmd)
So what filename would you need to create in order to do the most damage then?

Maybe this would be a bit safer:

                        tell application "Finder"
                                set pospath to (quoted form of POSIX path of f)
                        end tell
                        set cmd to rmcmd & " --  " & p
                        -- display alert "command: " & cmd
                        do shell script (cmd)

Also note the use of the double dash -- in the command, read the man page for why, but the POSIX path probably means that will not be needed.

Another tip, you stated that this is released under the terms of the LGPL, yet there is no notice of this at the head of this applescript...

[ Reply to This | # ]

Dangerous script
Authored by: Anonymous on Sep 15, '05 03:06:12PM
Nicely spotted. One tiny error in your revised version:
 set cmd to rmcmd & " --  " & pospath
I'd say this is the whole reason the Trashcan concept exists - it's too dangerous to tell the system to force delete the value of a variable, precisely because it's a variable. Stick to the three keystrokes: command-backspace / command-shift-backspace / return. It's much faster than right-click submenu navigation anyway.

[ Reply to This | # ]
10.4: Install an Automator action to delete files
Authored by: evan_escent on Sep 15, '05 03:27:44PM

Thanks mzs for your suggestions. Yes, I was expecting Automator to ensure that what I was given were actually files/folders, but this was a bit naive. I've implemented your suggestions (including the "--", has bitten be before... duh) along with a few others.

The new version has been posted, with cred for tips.

[ Reply to This | # ]