Revisiting Devonthink Annotations to Tinderbox

A group UUID is the portion of the group’s Item Link to the right of :\\

x-devonthink-item://FD334BA7-59EE-4882-828A-23341D071753

Group UUID == FD334BA7-59EE-4882-828A-23341D071753

Urgh, @PaulWalters beat me too it. But that’s two suggestions for TCV.

Even if one has CSV, just open it to Excel and re-save as TSV. Data-cleanse in Excel if needed.

Yup, I got the UUID after a bit.

x-devonthink-item://36FA37B2-77C8-4FED-B7F9-FCD383C05145

Pasted it in

Try running the script,

image

Does not work. Only think I can think of is that I don’t know what an “Index group” is vs a simple “group.”

This will get the current database and group UUIDs, display the info, and also put on the system clipboard:

tell application id "DNtp"
	set theDatabase to the current database
	set theGroup to the current group
	set theInfo to "Database UUID: " & (the uuid of theDatabase) & return & "Group UUID" & (the uuid of theGroup)
	display dialog theInfo
	set the clipboard to theInfo
end tell
1 Like

There’s no such thing as a “simple group”. Groups are either “indexed” external folders, or internal non-indexed groups.

But you shouldn’t have to know. And you shouldn’t have to futz with UUIDs.

The script needs to be rewritten so it doesn’t force the user to care what kind of group they are dealing with.

Thanks, I’ll quit now, floating up to the top of the fishbowl on this one…out of my league. :wink: (For now).

As regards PDFs, the ‘PDF’ library of Mac’s Automator (one of Apple’s less-loved offspring of late) has an ‘Extract PDF Text layer’ feature:

I don’t doubt AppleScript can probably do similar via Finder (or Preview?). The above is taken from a service I made to export PDF text to text files. Worked fine across c.2k PDFs. BUT what you get with OCR-ed docs is the OCR output which is often riddled with errors ( believe Adobe Acrobat and PDFPen Pro offer OCR text correction and even then I think it is a manual edit process. Digitally native docs, i.e. printed to PDF should likely have better text fidelity.

OOOH – Automator, yes. There’s an Automator action to extract annotations

1 Like

In case it helps a Zip of my PDF text export OS service file is here: Extract Text from PDFs.workflow.zip (102.4 KB)

Unzip and place the file in you user account Library: ~/Library/Services/ I’d check the newly-placed file has the same permissions as others in the folder (You: Read & Write, Staff/everyone: Read-only) . Once in place, select a PDF9S), right-click the selection and scroll to the ‘Services’ sub-menu and select the service.

2 Likes

Hi, I wonder why you didn’t ask in the script thread? :slight_smile:

Because I’m not a programmer and I’m not really that sure what your question means. I’m stumbling around in the dark looking for light switches of understanding.

I wrote this script and would be happy if you’d asked. It’s impossible for me to estimate what users know about an app or AppleScript so I don’t try to do it anymore and instead include only what’s specific about the actual script. However the only way that I could learn what might be necessary to include in a script’s instructions is feedback. You weren’t able to use the script and I didn’t know about it until I read your post here. That’s not how forums should be used, I think :slight_smile:

Good news. @pete31 has taken the time to develop and provide a step-by-step on a new approach to generate a TSV file based on Summarise Highlights and then import it into Tinderbox.

I’ve tried it out on a large summarise file of mine and it works as described. Below an illustration of the notes once imported and coloured.

1 Like

Ya!!! Got it working. Not sure why I had trouble the first time, but the second time I got it working in just a few minutes. :slight_smile: Thanks so much, @pete31. Too cool!

And more good news. @Pete has updated his Apple Script to include custom metadata from your DT3 files (I also learned to edit this file to add even more custom metadata…so very cool!). Here is the post for the updated Apple Script -Script: Create "Summarize Highlights" TSV for import into Tinderbox - #10 by satikusala - DEVONthink - DEVONtechnologies Community. It works great.

1 Like

Check out this great thread from @PaulWalters. It is perfect for or those people that don’t want to bother with AppleScript and are not concerned with pulling in custom fields or note type annotations into specific TBX notes. Paul, as he so often does, has made it really clear and easy.

An update on my side re. exporting Devonthink annotations to Tinderbox. Devonthink developer C. Grunenberg has just confirmed that the next release of Devonthink will allow the user to export Summarise Highlights directly into CSV format in addition to Markdown and RTF. I expect this will help simplify the export process to TB even further. See this link

3 Likes

Thanks for noting that. Can you or someone using this method post back here in this thread when the DEVONthink update occurs to confirm this issue is now essentially ‘fixed’? That will help later readers of the thread. :slight_smile:

1 Like

The most recent version of DevonThink (v3.6.2) now supports export of annotations to a .tsv file (the DevonThink spreadsheet format). I’ve tested it this morning with the following observations:

  • creating the .tsv file is very fast and convenient (an option in the summarise highlights menu)
  • directly dragging the .tsv file to Tinderbox does not work well. TB does not recognise it as a spreadsheet and does not generate a note for each line
  • dragging the file to the finder and then into Tinderbox works better. A new note is created for each line and the display attributes are populated and filed out.

It’s a step forward for sure and will help me in doing the highlighting in DT and text analyses in TB. I still see room for improvement on the TB side with the following elements:

  • Have TB recognise DT .tsv as a spreadsheet and generate a new note for each line in the sheet e.g. same function as the drag from finder which currently adds one more step. This should be low hanging fruit !
  • Have TB process and populate the headers or column names of the file to populate the display attributes in a better way. This is likely a little more involved. As an example currently the header of one of my .tsv highlight export files is fairly simple and show something like this:

“Document#string” “Location#string” “Type#set{values:Highlight|Underline|StrikeOut}” “Annotation#text” “Name#text” “Link#url”

which is translated in TB into the following display attribute

image

I would suggest that TB on-import used the type statement (e.g. #string for Document) to define the display attribute type and set the name of the attribute to the name of the column e.g. Document for column 1.

1 Like