Taking notes in Devonthink
Short post as I have several research projects that need to finish up before school starts in two weeks.
With help from some code on the DT forum (and my programming wife), I finally managed to come up with a smooth workflow for taking notes. I have literally 1000s of PDFs that I need to take notes on – a quote here, a paragraph there, my disapproval noted elsewhere. DT comes with an Annotation script that will create a new document (linked back to the original) that you can then take notes in. I don’t use it because (as far as I can tell) you can only have one Annotation document for each PDF. Since I am a member of the Cult of The One (Thought, One Note), that won’t work for me.
So as I would come across a salient point in a PDF, I’d do the following:
- Copy Page Link for the page of interest
- Create a new RTF
- Name the file with a summary of the point being made
- Tab to the Spotlight Comment and type/paste the citation info (even though I still use tabs for provenance info, I always include the cite info in the comments)
- Jump to the body of the RTF to type ‘###’
- Select this ### string
- Add a Link from that ### back to the original PDF page. It’s always good to have original (co)ntext at hand.
- Then start typing my notes.
Needless to say, this takes many steps – I made it a bit shorter with macros, but not short enough.
It wasn’t too long before I decided to figure out if there was a way to script all (or some) of this – this is especially worthwhile since the Add Link command is rather fussy at times. While having my ever-suffering wife tweak a similar script for an hour or so (dead-end, unfortunately), I pretended to make myself useful by searching on the DT forum for some relevant keywords. I soon found this code (New RTF doc from selected text and URL to PDF), which allows you to select text in a PDF and create a new RTF to take notes in, with the URL property of that RTF file linked back to the page of the original PDF. We added a prompt to title the new RTF (since I want my titles to have substantive meaning), to copy the PDF file name to the Spotlight Comment (since I’m reading an original PDF whose file name is not coincidentally the title of the work), and to open the RTF right beside the PDF, for easy transcribing.
I assign a key shortcut and it works like a charm, pasting the selected text into a new RTF. Now I can keep the original PDF open in one window, automatically create another RTF with a link and the required metadata, and send it to whichever group I want. The tweaked code (at the bottom of the forum thread) also opens the new RTF so you can transcribe or take longer notes as needed. Close it when you’re done, then go back to reading the original PDF, creating another note when needed.
But I’m not just recycling somebody else’s code to justify a blog post. This script is great for PDFs that have text, such as what you download from JSTOR or can OCR. But I also have 1000s of PDFs (manuscripts, newspapers, 17C treatises…) that have no underlying text at all because the text quality is horrible – and frankly those are far more deserving of notes. Yet the existing code insists on selected text, or so it seemed. As I became increasingly frustrated with my incompetence as a code-whisperer, wishing I knew how to replace the codespeak “select some text” with “Copy Page Link”, I fought back my rising rage (I wouldn’t make a good programmer) and decided to just cheat. I hypothesized that if I can’t select text (because there’s none to select), maybe I’ll just select the whole page (not in the thumbnail sidebar) and see if it works. And it does! Sends you right back to the page in question, in fact.
So you can use the same code to select a whole image page (drag anywhere on the page, or just Command-A). It won’t paste the image into the RTF, but who cares: you have the link back to the original, and I want to automate steps 1-7 anyway.
In the process I learned that RTFs have a URL property – in the above image, the blue link in the RTF window right above the style ribbon. I knew bookmarks had them, but bookmarks seemed somewhat useless to me since you can’t add any text. So not only have I saved myself half-a-dozen steps for each note, but using the URL property also has the advantage of avoiding my workaround, which was to type some non-alphanumeric characters, like ###, in the body (so they wouldn’t screw up the AI), select those characters and then Add a Link back to the original PDF page (via Copy Page Link). Of course the URL property only works for the entire RTF; yet another reason to stay on the straight-and-narrow path of One Thought One Note-dness.
So now I just need to figure out how to paste the summary file name into the body of the RTF (so the AI can do its thang), and I’ll be all set. Good times.