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

10.3: Use Folder Actions to add the trash to the sidebar Desktop
Here's how you can use Panther's Folder Actions to create an icon for the Trash on your desktop, or the Finder toolbar/sidebar. Note that the icon won't change depending on whether there are items in the trash.
  1. Launch Script Editor and type in this code:
    
    on adding folder items to thisfolder after receiving theseitems
      tell application "Finder"
        repeat with i in theseitems
          move i to trash
        end repeat
      end tell
    end adding folder items to
    
    on opening folder thisfolder
      tell application "Finder"
        set target of the front window to trash
      end tell
    end opening folder
    
    Save the script to ~/Library -> Scripts -> Folder Action Scripts and name it "Trash."
  2. Create a folder on your desktop named "Trash." You'll probably want to change its icon to match the Trash.
  3. Enable Folder Actions by control-clicking on the Desktop and choosing "Enable Folder Actions".
  4. Control-click on the folder "Trash" and choose "Attach a Folder Action." Browse to ~/Library -> Scripts -> Folder Action Scripts (if it's not already selected) and choose "Trash." as the script to use.
And you're done. You can add this folder to the Sidebar in Finder windows, or right-click the Toolbar and choose "Customize" and then drag this folder onto your Finder toolbar.

[robg adds: An anonymous hintster sent in another method -- use Tinkertool to make your hidden files visible, find the .Trash folder in your home directory and drag it to the sidebar and/or toolbar, then disable viewing hidden files. Paste a custom icon as you wish. I think the Folder Action Scripts method is cleaner, in that you'll be moving things to the "real" trash as opposed to the one in your home folder. For example, I'm not sure what happens when you drag a file from another volume into your local .Trash icon -- does it copy it to your local trash while leaving it on the other hard drive?]
    •    
  • Currently 2.00 / 5
  You rated: 1 / 5 (8 votes cast)
 
[15,158 views]  

10.3: Use Folder Actions to add the trash to the sidebar | 7 comments | Create New Account
Click here to return to the '10.3: Use Folder Actions to add the trash to the sidebar' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Use Folder Actions to add the trash to the sidebar
Authored by: eleon on Nov 05, '03 11:07:07AM

or just customize your finder toolbar and add the delete icon!



[ Reply to This | # ]
Works in Jaguar (10.2)
Authored by: sinjin on Nov 05, '03 12:38:56PM

Simple and effective, thanks.

About the delete button in the toolbar: For some reason my "muscle memory" sees this as two steps - I think because the delete button SHOULD support drag and drop (like everything else) but doesn't. It's a minor nit to pick but I know I'm not alone now!



[ Reply to This | # ]
10.3: Use Folder Actions to add the trash to the sidebar
Authored by: DavidRavenMoon on Nov 05, '03 09:08:17PM

why even bother dragging files to the trash?? Just hit Command-Delete! Or use the new Action pulldown on the Finder toolbar and select "Move to Trash."

Kind of amazes me how Mac users go through all kinds of contortions to reinvent the wheel!

:)

.

[ Reply to This | # ]

10.3: Use Folder Actions to add the trash to the sidebar
Authored by: skye on Nov 12, '03 07:52:29AM

Fear of the unknown, I think they call what you have. The only way to evolve is trying to find new and better ways to do stuff, some might seem dumb and redundant at first, but in order to be able to get to C, you must first develop B (as in A + B = C) in order to bridge the gap.

If no one tried to make things in a better way we'd still be on Mac OS 1, or the personal computer wouldn't have been invented, or tools, or cooking... it's all about emergent systems. Needs.

Do yourself a favor and read "Out of control" by Kevin Kelly. Then come back and write some nifty tips.

(btw, invention is not a mac user trait, it's a human thing)
(though it's nice of you to think so)

---
The very Skye



[ Reply to This | # ]
There *are* other reasons...
Authored by: jiclark on Apr 05, '05 11:45:22PM

For me, I've been looking for a way to have an easily-clicked Trash icon somewhere because I've almost completely stopped using the Dock. I have it hidden at the top of my screen, and those few times that I need to *look* in the Trash, it's a pain to do so...

So this hint might just be what I've been looking for! (And yes, I exclusively use Cmd-Delete to put things in the Trash...)



[ Reply to This | # ]
10.3: Use Folder Actions to add the trash to the sidebar
Authored by: aranor on Nov 06, '03 04:05:37AM

For adding .Trash to the sidebar - no need to show hidden files, just press Cmd-Shift-G for the Go To Folder dialog and type <tt>~/.Trash</tt>. then you can drag the proxy icon to the sidebar.



[ Reply to This | # ]
10.3: Use Folder Actions to add the trash to the sidebar
Authored by: marby on Jul 03, '05 06:43:06PM

I tried this procedure in Tiger (writing the Script) and it worked but resulted in an unwanted side effect consisting of a blinking title bar on each window. When I removed the script the problem went away. I decided to go with the delete icon in the Finder and that seems to be a better solution.



[ Reply to This | # ]