Sort groups after amount of files under each group


I have many hundreds of indexed folders (groups in DT) in the database and have files under every group.
I have unzipped files to the groups that seems to have failed and now have not all files in many groups.
But I see to the right of each folder that DT can count how many files it is under each group.

So I just wonder if I can with a script or with a function in DT to sort all my groups after how many files it’s under each group?

This would help me a lot to see directly where I need to do some unzippings :smiley:

Thank you in advanced for the reply!

If you have files suddenly gone missing in your database you’d be better off opening a ticket with Support than looking for a script to sort your groups.


I don’t normally import zipped files or folders into a DEVONthink database. Why? DEVONthink cannot index the text of documents in a compressed file or folder. So no textual information value results.

Just for grins, I imported a zipped folder that contained two files, a PDF and a .docx file, into an existing group in a DEVONthink database.

That added 1 file to the count of that group.

Next, I Control-clicked on the newly imported item and chose the option to show it in the Finder. In the Finder, I could double-click on it to unzip it, so did so. Indeed, now in the Finder view of that folder that’s stored inside my DEVONthink database, I could see the two files that it contained.

But back to DEVONthink, the group into which the zipped item was imported did not show any increase in the number of items it contains. If I select the imported item I can see an image of a folder, but it won’t open, even though it shows a size of 90.2 KB.

DEVONthink was “unaware” of the fact that I had unzipped the imported compressed folder, as I did that from the Finder. It didn’t update the number of files in the group that contained the imported zipped folder, and although I see an apparent “group” that holds those files, it cannot be opened to display them.

Next, I ran Tools > Verify & Repair on the database into which I had imported the zipped folder. An error report showed 2 orphan files. I clicked Repair and those files were moved to an Orphaned Files group in the database. Verify & Repair had identified 2 files stored within the internal Files.noindex folder, that had not been indexed or assigned a group location within the database – in other words, “orphans”. Yes, those 2 files were the ones that had been contained within the zipped folder, and stored in Files.noindex when that zipped folder was uncompressed by my external action from the Finder.

Orphan files must be refiled into the database, in order for DEVONthink to index them and assign to them a location within the organizational scheme of the database. I decided to file them into the Inbox group of that database.

Now, from the original import of a zipped folder, I’ve got 4 items added to the database: the original zipped item, the 2 files found within it when the item was unzipped and that had been refiled into the database, and an empty group that doesn’t contain any files, but which I could search for and into which i could now move the PDF and .docx files.

That’s why I don’t capture zipped items into DEVONthink. :slight_smile:

Hi again!
First I want to say that this problem doesn’t have with devonthink to do. It was my unzip application that I use to unzip the files to folders on my system. The only thing I wonder about was if it was some functionality to sort groups with it’s amount of files under respective group?

So please, everything is ok with devonthink, it works wonderful so no worries.
Just more a functionality question about sorting groups…