This may not be the solution you are looking for, but you could create a Folder Action
to attach to your "/Users/your_shortname/.Trash" folder which logs the file name and date of every item sent to the Trash.
This following AppleScript Folder Action
code will create the file "Files_Added_To_Trash.log" on your Desktop, (if it does not already exist) and writes the file name and date it was added to the Trash folder, to it.
Paste this following code into a new Script Editor.app document and save it as "Log_Trashed_Files.scpt" to your "/Users/your_shortname/Library/Scripts/Folder Action Scripts" folder.
Saving the file to that location will make it available in your "Folder Actions Setup.app" and when right clicking on a folder in Finder and choosing "Folder Actions Setup"
property addedToTrashLog : (path to desktop as text) & "Files_Added_To_Trash.log"
on adding folder items to theFolder after receiving theNewItems
-- Called after items have been added to a folder
-- theFolder is a reference to the modified folder
-- theNewItems is a list of references to the items added to the folder
repeat with thisFile in theNewItems
set currentDate to (current date) as string
tell application "System Events" to set theFile to name of thisFile
set theText to theFile & " was sent to the Trash on " & currentDate
do shell script "echo " & quoted form of theText & " >> " & ¬
quoted form of POSIX path of addedToTrashLog
end repeat
end adding folder items to
on removing folder items from theFolder after losing removedItemNames
-- Called after items have been removed from a folder
-- theFolder is a reference to the modified folder
-- removedItemNames is a list of names of items removed from the folder
(* You may want to add code to this section which removes the log entry
from the "Files_Added_To_Trash.log" file for the files that get emptied from
the Trash folder. *)
end removing folder items from
In Finder, simply right click on the .Trash folder in your Home directory and select Services/Folder Actions Setup... If you can't see the ".Trash" folder in your Home directory (/Users/your_short_name/.Trash) folder, clicking anywhere on your Desktop and then keyboard shortcut ⌘Command+⇧Shift+
. should un-hide all files.
Now, anytime a file is sent to the Trash, the name of that file and the time and date it was sent to the trash will be added to your "Files_Added_To_Trash.log" file.
mdls
shows only very limited metadata for files in Trash - just file system metadatakMDItemFS...
, not file content. Conclusion: Spotlight does not index the content and metadata of files in the trash. Hence:mdls
will not showkMDItemDateAdded
.mdls
doesn't show akMDItemDateAdded
property.kMDItemDateAdded
is shown when I put back the file, and it disappears again after I move it to Trash. However, this means thatmdls
ist not suitable for showing meta data of items in Trash, but then what is?