The Mac OS X 10.6 Trash shows an option "Put back" for files that were trashed after installing 10.6. However, it does not show where the file will be put back to.

So: using Finder, is there any way to tell where a trashed item came from?

(I know the original locations are stored in ~/.Trash/.DS_Store, so if I really need to know where a file came from, then I can figure it out using something like hexdump.)

link|improve this question

Out of curiosity: why would you need that? If you know where it was, you can simply put it back, and if not, just drag it out of the trash onto the desktop and move it from there wherever you want it to be. – brandstaetter Oct 23 '09 at 10:55
For example if two different trashed documents/folders have the same name and I want to figure out which item to restore. Or if someone accidentally deletes some settings file, and then some time later I find that unknown item in the Trash. (Of course, system files cannot be deleted without providing an administrator password.) Or if I just see some strange files which make me very curious of where I got those. ;-) – Arjan Oct 23 '09 at 11:04
To distinguish between 2 documents, you could use quicklook. – brandstaetter Oct 23 '09 at 11:08
Sure, I know all the workarounds. ;-) But now that 10.6 introduced this "Put back", I was hoping for some control over that... – Arjan Oct 23 '09 at 11:38
You realize you're talking about the closed Apple ecosystem :) Perhaps we'll see that in 10.6.9 or 10.7 ;) – brandstaetter Oct 23 '09 at 12:12
show 2 more comments
feedback

1 Answer

up vote 5 down vote accepted

I saw this problem and was intrigued. I ended up writing a quick Foundation tool based on this function and wrapped it in an AppleScript application.

http://dl.getdropbox.com/u/896591/PathForTrashItem.zip

Stick it in your toolbar and it should tell you the path for the selected item. I make no promises. :)

It shouldn't ask you for your password. If it does, something is odd. You can still open the application with AppleScript Editor, if you want to look at the AppleScript source.

Two main issues:

  • The Finder appears to update the .DS_Store file periodically, so it might fail for items you recently added to the Trash.
  • It can only handle one item at a time.
link|improve this answer
That beats hexdump for sure. :-) And that cocoadev.com/index.pl?ParseDSStoreFiles surely seems interesting as well. My Google-Fu failed me badly! – Arjan Oct 24 '09 at 15:35
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.