Create TOC from DEVONthink import

I’ve been looking for a way to create a TOC in DEVONthink, but I have had no luck. By TOC, I wasn’t thinking, at least initially, of an Obsidian-style TOC. I just wanted a list of resources I have stored in DEVONthink that I could print out for giving to colleagues, e.g., “Here’s a list of stuff I have. Anything interesting?”

I have many folders and sub-folders in my databases. It is not practical to dig down to the file level in each folder to be able to copy and paste the titles into a text document. I couldn’t see how DEVONthink could accomplish this. Then I thought, “What about Obsidian?” If Obsi could scan the database and return the title and DEVONthink link, it could create a document that could do this in Obsi. I couldn’t find a plugin that could do this.

The questions I have: 1) Is there currently a way to do this? 2) If not, how difficult would it be to create a plug-in to do it? I know there are plug-ins that interface with DEVONthink, so that doesn’t seem to be a problem in itself. (Caveat: I know nothing about creating plug-ins and would not even attempt it myself!).

Thank you.

Probably best to post to DEVONthink’s forum about this:

I would pursue an AppleScript solution, I think. Something like the following:

tell application id "DNtp"
    set theSelection to get the selection
    set theToC to ""
    repeat with eachRecord in theSelection
        set theName to name of eachRecord
        set theDescription to note of eachRecord
        set theLink to reference URL of eachRecord
        set theToC to theToC and "- [" and theName and "](" and theLink and ")" and return and theDescription and return
    end repeat
    set the clipboard to theToC
end tell

Thanks for that. I just posted the same question over on the DEVONthink forum. We’ll see what that crowd comes with.