@cgrunenberg @Stephen_C @Blanc @pete31 @BLUEFROG
I think that there is a big misunderstanding as to the purpose of my Typinator workflow above. The misunderstanding is totally my fault for not going into enough detail in my explanation. I did not want to add to an already long text.
It is basically designed to address what one could consider a bug in DevonThink. If the term bug is too strong or it is not a bug, I apologize to @cgrunenberg
In 2020 I migrated from Evernote to DevonThink and followed the DevonThink procedure to do so.
I had 11,000 + Evernote notes. In the migration process (DevonThink → File → Import → Notes from Evernote). My evernote notebooks (=groups=folders) were imported as groups and each one of those groups filled up with the Evernote notes belonging to that notebook/group.
So far so good.
The problem is that for some mysterious reason, DevonThink automatically converted thousands of Evernote notes into subgroups. One example: if I had dragged and dropped a research study PDF into Evernote (= 1 note in Evernote), the result after the DevonThink migration is not a single item, but instead a subgroup with the same title as the Evernote PDF note, but containing 2 files. One is the pdf (sometimes with a bizarre name) and the other is an html file containing the URL link which opens the PDF file. (note: there are no indexed files in Evernote. All files are imported). There are many many variants of the kind of item titles and content you can find in those subgroups. I tried multiple times deleting the imported Evernote groups and notes in DevonThink and re-importing, but the results were the same.
In itself, it’s OK. A minor migration glitch that I can live with. The problem however is that following a migration from Evernote, the DevonThink search popup (in all forms) becomes useless because all these thousands of supplementary subgroups are included in search results. For example, if I type “DevonThink” in the search popover, instead of seeing the less than 5 actual groups/subgroups with DevonThink in their name, I get about 150 results (98% subgroups created during the Evernote import), and I end up having to scroll up and down to find the correct group. It is very tedious and time consuming if you consider the many times a day I use the DevonThink search popup. By generating a list of groups and subgroups (thanks to @BLUEFROG 's script), I can clean up all the garbage subgroups and, using Typinator end up with what the DevonThink search popup should look / feel like.
If I did not have this problem I would not have created the Typinator based workflow, and if I did, I would be crazy wasting time on this project.
I still have the Evernote file (ver 7.1.4, before their big change of platform). If necessary, I could delete all the Evernote notes in DevonThink (kept in a separate database) and start over again if @cgrunenberg or anyone else has a solution.
thank you