Bookends, DT3, and annotations


I am sure I’m not the only one trying to do this, but I’m keen to know the best-practice way of going about it:

  • I have all my references in Bookends
  • many but not all of these references have attachments

What I would like:

  • an item in a DT3 group for each item in Bookends
  • User20 in Bookends set to the DT url
  • DT url field set to the Bookends item

I have found a script that does this for Bookends items with attachments but in my field lots of references don’t have attachments — I still want to create DT3 items for them. The gold plated ideal for me would be a group that keeps in sync with my Bookends library, with an indexed item if there’s an attachment, and I guess an RTF document if there’s no attachment.

Then keeping annotations:

  • I like highlighting PDFs as I read them
  • I want to convert these to individual DT3 notes
  • I want to keep a connection between the notes and the DT3 item which represents the Bookends item
  • I also want to be able to do similar notes

Should I be using Federiko’s Annotation template? Can I use it to convert PDF annotations to DT3 annotations?

Apologies for my ignorance - feel free to point me towards the best forum posts. I’ve had a search but have ended up more confused by the variety of options than enlightened.

1 Like

Did you try File > Import > References from Bookends…? This creates rich text document linking back to Bookends.

Yep but that doesn’t give me the attachment as an item in DT3. If an attachment exists, that’s what I want to be the DT item

From what I’ve read on these forums over the years, many people index the Attachments folder from Bookends, typically ~/Documents/Bookends/Attachments.

  • I like highlighting PDFs as I read them
  • I want to convert these to individual DT3 notes

You could use Tools > Summarize Highlights to create a new document with the annotation data.

  • I want to keep a connection between the notes and the DT3 item which represents the Bookends item
  • I also want to be able to do similar notes

You can use Data > Copy Item Link on a file to get it’s reference URL (Back Link). That can be pasted into the Summary document, if desired.

Should I be using Federiko’s Annotation template?

That would be a question for him, or you could just test it out.

Can I use it to convert PDF annotations to DT3 annotations?


Thanks for this. I’ve got a bit further along. Federiko’s Annotation template isn’t quite what I’m after (although it is very cool). Summarize Highlights is great but I want one file per note. The closest to what I’m after is the DT2 “Annotation…” script, along with “Reference (from Bookends).templatescriptd”

Here’s what (I think) I want:

  • I’ve created a group called “Library”
  • each reference in Bookends, whether it has an attached PDF or not, gets a group named “Author Year Short title”
  • inside the group is either:
    • a document along the lines of those created by “Reference (from Bookends).templatescriptd” - this puts the Bookends keywords into the DEVONthink tags, for example, and I’ll set the URL to the bookends://item
    • an index to the attached PDF if it exists, again with tags set to keywords, etc.
  • annotations get put into the group, one note per highlight or other annotation, with the URL set to either the PDF page or just the reference if there’s no PDF

I’ve found an Applescript that I think I can use to create the groups, and I think I can figure out how to modify other scripts/templates to get what I’m after.

The one bit I don’t have an answer for at the moment is converting PDF highlights to notes. I have a lot of existing PDFs with highlights. I’ve had a look at the DEVONthink Applescript dictionary, and I’m probably being dumb but I can’t see a way to iterate over the PDF highlights. Is that possible? Or would I need to do something e.g. with skimpdf to create a bunch of text files and then import them?

I can’t speak to skimpdf as I don’t use it.

I have a lot of existing PDFs with highlights.

So you’re intending to end up with hundreds of individual notes??

So you’re intending to end up with hundreds of individual notes??

Well, yes. Up until now I’ve been keeping one document in DT per reference. The problem is visibility - I want to surface each of the difference notes.

Is there a way to iterate over PDF annotations/highlights in Applescript?

Or I guess as an alternative, is there a way to script the “Summarize Highlights” menu option? Extracting into a single note is probably better than not extracting them at all :slight_smile:

Sorry, but no you can’t access PDF highlights via commands in our AppleScript dictionary.

The application Highlights can do this, and it has links to Devonthink. Whether it will read your existing annotations is a matter for the usual ‘Which bit of a pdf will work for any given program on any given day’ lottery, but it may be worth a look. I don’t use it anymore (I use a modified script to take notes directly within DT) but I seem to remember it being useful. NB I haven’t tried it with DT3 yet!

There’s a demo available:

BTW — DT3 is amazing. And so is the Help file. Just wanted to say that. I’m greatly enjoying the new side-by-side view on my external monitor.

So, having tried out Summarize Highlights - it’s pretty awesome and does most of what I want.

And I’ve tried out the Annotation tool in the Inspector - also awesome because it’s integrated. Like others, I wish it supported Markdown! But I can see the long-term benefit of using the tool that is built in to DT instead of something external, so I reckon I will stick with that, and hope that I can switch to Markdown in the future at some point

And so is the Help file.

Woohoo!! :wink:

Which inspector actually - Inspectors > Documents > Annotations or Inspectors > Annotations & Reminders?

Both, but in this case I meant Inspectors > Annotations & Reminders. Being able to see the linked annotation in the pane to the right of the actual document is what I like. If there was a better way to pull out the PDF highlights & details (I guess via Summarize Highlights?) into the annotation document that would be even better.

(I guess via Summarize Highlights?)

Correct. :slight_smile:

I guess my ideal world the two would be integrated. Maybe that will come in the future!

I gave up trying adapt Bookends for my requirements, also gave up trying to use DT’s rather cumbersome (imo) approach.

For annotations and highlights in DT, my solution has been to tag each pdf where i have highlighted text with a unique number. I copy and paste the highlighted text to an rtf note and tag it with the pdf tag number. I create a smart folder search on the tag number: the name of the smart folder using the same name as the pdf for sorting. Hundred of individual notes yes, but each found at a glance.

It would be helpful if you could include a link to that script.

Along the same lines as my previous message, a link would be wonderful if that script is downloadable somewhere.


It’s modified from a number of scripts written in 2014 by korm and then modified and developed by Frederiko (both of whose contributions are outstandingly helpful in so many respects. I’ve just butchered their work.).

There are two scripts, called by Keyboard Maestro to populate a dialogue box to enter variables which are then incorporated into the new annotation document. Unless you actually use Keyboard Maestro, the scripts themselves don’t work properly.

Basically, I select a pdf/rtf/webpage in DT3, optionally with some text highlighted and invoke the script to get this dialogue:

This creates the following document:

Bits to notice

  • the page number is attached to the source code and is prepended to the title (so you can sort references by page number. The ‘real page’ bit is to differentiate between pdfs which start on page 97 rather than 1 – the link goes back to the pdf page without bothering your written reference.

  • if you choose to make it an event, it brings up another dialogue with dates etc.

  • various group tags are added, and the annotation inherits those from the source doc.

As you can see, while its based on the marvellous work of frederiko and korm, it’s been heavily and clumsily hacked to fit my setup and workflow (e.g. the exact layout and fields in the dialogue box, the exact layout of the note document etc), and it absolutely requires Keyboard Maestro - I don’t think anyone could really just install the scripts without doing a fair bit of modification themselves first.

I am happy to post them, but I think both korm and Frederiko have moved on to other methods so there may be better examples out there. They are also very rough and ready because I know and work around the problems rather than fix them… :wink:

They would be useful to me, if don’t mind sharing them :wink:
I also use keyboard maestro. A lot.