Desktop Trash


When passed an alias, the script moves the original file or folder to the Trash. This is an easy path to data loss. I do not recommend the use of this script.

I don’t use the Mac OS X Dock, and want to have the Trash on my desktop. I used DragThing for this for a long time. The main problem with DragThing’s desktop Trash is that it is not a real Finder item. This means that the Finder will place newly saved files underneath it.

I made my own desktop trash. It is a real Finder item: technically an application.

I put this script into AppleScript Editor:

on run
    tell application "Finder" to open the trash
end run

on open draggedItems
    tell application "Finder" to move draggedItems to the trash
end open

I saved this script with the file format ‘Application’ and put it on my desktop.

The on run bit runs when the application is run by opening it directly. The on open part of the script runs when files or folders are dragged onto the application icon.

The finishing touch was to change the icon to the Trash icon. Open the Info panel for the Trash, select the icon and copy it. Then open the Info panel for the new ‘application’, select the icon and paste.

This desktop Trash does not change its icon as the Trash is filled and emptied, as DragThing’s Trash does. I like the simplicity though.