I’m stuggling to understand and control emptying the trash. I did look at some older posts but didn’t find anything current that’s related. I did read “Finally, old posts are of course not the best/latest guide and frequently outdated or even wrong” at Afraid to empty trash, so I’ve decided to take the plunge and post my question.
I have read the manual carefully regarding the two possible dialogs I might get with respect to indexed items. The “Only in database” dialog I’ll call “OID”. The “Remove Imported Items” dialog I’ll call “RII”. I know I’ve seen RII in my actual work. But, I’ve set up a sample database, trying to duplicate the various situations the manual mentions, and I can’t get RII to display.
I have a feeling I’m just not interpreting the manual correctly. In “If you delete a subgroup or file in an indexed group”, is an “indexed group” the same as an indexed folder? I’ve certainly set up the example where I indexed a folder and deleted files at various levels in the resulting indexed tree structure and I always get the OID dialog.
I do have a couple of related questions, but an answer to just this one could turn on a light bulb for me and answer them all.
Indexing means that your file in DT and in the macOS Finder should remain in sync. What you do in one should reflect in the other. DT allows you to bypass this sync when you delete a file by the OID dialog. When you delete only in database, the file remains undisturbed at the macOS Finder level.
Importing disconnects the files in DT from their sources in the macOS Finder. When you trash an imported file, you are removing it from the database in DT but not affecting the source in macOS Finder. Hence the RII dialog.
By specific example, I find a distinct advantage of indexing in DT versus working other data management tools (e.g. Obsidian) is that indexing provides a way to leverage the power of searching in DT to find such things as duplicates or “fluff” files (e.g. .aux and .log files in LaTeX) across an entire set of indexed content and delete such cruft en masse also at the macOS Finder level. In such cases, one would not select OID as the option when emptying the trash for indexed items.
Yes, but the location is important (and this is why we distinguish between group and folder).
A group, indexed or not, is in a database.
A folder, indexed or not, is in the Finder.
To clarify (hopefully) the Trash behavior (which is really not that complicated)…
First of all, you need to understand these two terms:
An indexed parent is the item you indexed from the Finder. This could be a Finder folder or an individual file.
An indexed child is an item within an indexed parent, e.g., a subfolder or a document inside a Finder folder.
When emptying the Trash…
If DEVONthink detects any number of indexed child items are in the Trash, you will get this message when you try to empty it (regardless if there are also imported items)…
If DEVONthink detects any number of indexed parent items are in the Trash, you will get this message when you try to empty it (even if there is only one indexed parent item)…
(PS: While the term parent isn’t necessarily consistent with individual files as they can’t contain child items, people often index folders which can contain children. We don’t feel it’s too far a leap to understand the term being used to describe files also.)
“parent” is something I explicitly chose to index by either dragging it into DEVONthink (holding the modifier keys down to index rather than import) or by selecting the object when using “File>Index Files and Folders…”. I assume that’s what you mean by “you indexed”.
“child” is anything that is indexed as a consequence of being a descendant of a parent.
If my understanding is correct, then there’s a bug. With my trash having only a single child, I get the OID dialog when emptying the trash. I did a very short screen recording using QuickTime Player. It’s 24 MB in size, so I won’t try to upload it.
A summary of the video: I created a folder named “parent” using Finder. I added a single file into that folder named “child.txt”. I dragged “parent” into my empty Tester DEVONthink database, holding down cmd-alt. In DEVONthink (where both the parent and child displayed the small finder icon indicating that they were indexed), I selected “child.txt” and hit delete. After I confirmed the delete, the single child appeared in trash. When I right-clicked on the trash and selected “Empty Trash…”, I was prompted with the OID dialog.
Thanks for the screencast!
Interesting… I just reproduced the behavior that wasn’t happening in one database but did when I moved the indexed parent group to another database.
My sense is that it’s somewhat random. I’m almost always just deleting children. Sometimes I get one dialog, sometimes the other. That randomness is the source of my confusion.
I understand the dialog inconsistency will probably make its way to the developers to address. The other part of my question is more about how to control the emptying of the trash.
If there are two possible dialogs that might be presented, I wonder what would happen when the trash has a mix of parents and children. Even if the dialog inconsistency were addressed, there wouldn’t be the ability to control emptying the trash using just one of the dialogs when it has mixed content. What is the reasoning here and how should a user handle this?
Is there any way to partially empty the trash, where the user selects a subset of files to remove?
The way I work now is that I’m super diligent about emptying the trash; I can’t risk its emptying doing some damage. I delete something then immediately empty the trash. Essentially, the trash provides absolutely no utility since I can’t really trust it with indexed items.
If there’s an indexed parent detected, it should prompt with the Only In Database dialog.
Is there any way to partially empty the trash, where the user selects a subset of files to remove?
Only on a per-database basis. You can open the top-level Trash group and empty a specific database’s Trash but no, you can’t empty a selection of items in a Trash,.
PS: I would ask what your are reasons for indexing versus importing.
Thanks for the info. That’s probably why emptying the trash has created problems for me in the past. If the trash also has a child in it and I select “Only In Database”, the file system’s structure becomes inconsistent with that of DEVONthink’s. When that has happened to me in the past, I’ve found no way to recover. “Update Indexed Items” did not fix it.
Without some way to pick and choose which items to empty from the trash, counting on it is a risky proposition. If I let it get into the mixed state, I can’t safely empty it without very careful thought; sometimes I can’t empty it at all without restoring some of it before I do.
I only have DEVONthink on two laptops and a phone. Not only are there other Mac’s in my family that need access to some documents, I also use a Window’s machine at times. Sometimes I even need to provide temporary guest access to some document via a shared link. Dropbox plays a central role in document sharing, much more so than DEVONthink.