Make Command-Delete do more with Quicksilver

Jan 25, '07 07:30:00AM

Contributed by: Anonymous

When an application does not have an uninstall option, I use a simple little (free) application called AppDelete to make sure that related files are removed from my system when I delete an application. But I occasionally forget to do this, because I always use Command-Delete to send things quickly to the trash.

Using Quicksilver and AppleScript, I've set it up so that Command-Delete will do the following:

Read on for the script and implementation details...

Here is the very simple script, which could certainly be improved upon:

tell application "Finder"
  if frontmost then
    set selected_items to selection
    repeat with i in selected_items
      set one_item to i as alias
      set k to kind of (get info for one_item)
      if k = "Application" then
        open one_item using application file id "com.apple.AppDelete"
      else if k = "Volume" then
        eject one_item
      else
        move one_item to trash
      end if
    end repeat
  end if
end tell
In Quicksilver, I set up a trigger bound to Command-Delete (the Set Keys box will look like you've pushed only the Command key) that uses this script as its object and run as its action. Please note that, as of now, AppDelete can only take one application at a time, so trying to delete multiple applications at once with this script won't work.

[robg adds: I haven't tested this one, but one of the most-often asked questions I get (usually from Windows switchers) is how to delete an application and all its associated files. AppDelete, even without the script, appears to be a fairly safe way to do just that. Personally, I just leave the cruft in ~/Library until it's time for the next major OS X release, but I know some people like to clear up all the bits of removed applications.]

Comments (16)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070124062402636