QuoteHighlight&Annotate script

This is just wonderful! I’ve been in desperate need of something like this script. I wonder, though: is there any way to grab the PDF page label rather than the literal page number for link labels? I have a lot of documents that are paginated as, for example, “22:338,” and it would make citing the quotations a lot easier if I could see those in the file the script generates. I looked through the DEVONthink AppleScript dictionary without finding anything promising, but thought it couldn’t hurt to ask. Thanks so much!

That’s indeed a great template!
I use it everyday to summarize my documents but I still have an unsolved issue: it happens frequently to me to “process” again a document that I already summarized; if I add a new Quotation&Annotation entry for a page, the new entry will be appended to the end of the file and it will not be aggregated to the other entries already existing for the same page.

How can I modify the Applescript so that Quotation/Annotation entries are added at cursor position instead of appended at the end of the file?

One can even think of making the insertion completely automatic (the script locates entries relevant to the same page, if any, and inserts the new entry among them) but I think that the simple placement at cursor position is a more flexible solution.

Thanks for your help

This is a great script but I’m wondering how to modify it to generate a new note for each quote / selected text. This would give the ability to tag quotes separately rather than link tags to entire articles and thus help fine-tune queries and analysis.

Only stumbled across this script now - great one! Many thanks – particularly useful how repeated selections from a single PDF are fed into the same annotation.

This is a great script - thank you all who contributed!

One question (which I guess is easy if you understand the script code) - the new file is saved in the global inbox. Is there any way to make that default save location in the same folder as the source file? Or if not, the inbox of the same database?

This is a wonderful script… I’m wondering if it might be able to slightly amend it by adding an addition feature. Namely, is it possible to include a Text link work so that actively highlight the quoted/selected text when you click on the link? That particular Text link feature is contained in the (brilliant) script for “annotation files for each citation plus notes+tags” found here:

[url]Make an Annotation with Links, Notes, Tags v2]

IMO, adding this feature to the script would make it even better…!


This is one of the great DTP scripts, and I love how it has developed…

I originally thought that the QuoteHighlight&Annotate script provided a way of collect multiple quotations for single documents, though I might have misunderstood how it can be used… As far as I can tell, the script can only be used to create one quote/annotation per document.

Is that right or have I misunderstood how to use it? If it does work for way I first understood, how can one use it to copy & paste multiple quotations for single documents?


A modified version of the script is included with this post to include a text search link after each annotation.

That is actually what the script does. Every time you run the script it adds the highlighted text of the document being annotated to the end of the annotation document.

QuoteHighlight&Annotate+Text links___Cmd-Alt-Q.templatescriptd.zip (41.3 KB)

Thanks so much, @Frederiko. The added Text link really improves this script!

I wonder… Is there any way one can adjust this script can collect multiple quotations from disparate documents? This script and the other one for tags that you created are brilliant. But I’m trying to figure out how best to create a memo document (built around a thematic topic) and, as part of that, copy marked up PDF’s and copy them into a memo – using the same features found in the QuoteHighlight&Annotate script (now enhanced by your terrific text link addition).

Is this possible? Or is there a work-around solution you’d suggest?

Thanks so much for help, and terrific work!

Thanks for these great scripts…
I am also looking for something to let me create different annotation files per document, to better find related annotations by means of DT’s AI.

Here is a new version of the annotation template that works with OmniOutliner Pro instead of DT’s native text editor.

The advantage of using OmniOutliner:

  • The annotations can be sorted by page number if they have been added out of order.
  • There is a search link with each annotation for referencing text in rtf files.
  • The quickview of OmniOutliner files that DT displays in its own window is really well implemented. You can’t edit the outline from a DT native window but you can collapse and expand outlines, and the outlines respect the view state given to them in OmniOutliner.
  • The annotations are added after the selected row rather than always at the end. This makes it easier to order the annotations as you insert them.
  • The templates are easily customisable and ideally suited to visually structuring information.

The Pro version (which is necessary to work with this template) is expensive but Omni has a trial download on their website, so you can see if this workflow works for you. Personally I find it a terrific tool to write in, and its superb applescript support means its very easy to integrate into my DT workflows.


[edit] fix to hopefully solve korm’s problem
[edit] a version of this script which properly handles umlauts and other non-english letter may be found here http://forum.devontechnologies.com/viewtopic.php?f=20&t=21114
[edit] a version of this script for taking notes across multiple documents can be found here http://forum.devontechnologies.com/viewtopic.php?f=20&t=20377
Omni_QuoteHighlight&Annotate v1.01___Cmd-Alt-Q.templatescriptd.zip (63 KB)

The script fails, over here, at this statement

with this error

The document mentioned actually exists (at the root of the database) and OO4 can open it with no problems.


Thanks for this. I’ve been looking at OmniOutliner for the longest time… A few months back I took the plunge on OmniFocus Pro across all my devices – it’s a really solid programme, and no doubt OO would be the same… I’ve been hesitating since I’m unclear how much I’d end up using it… Things like this are driving me closer! :slight_smile:


Thank you so much for this wonderful script. The integration with OO is flawless.



hello and thank you very much for this script.
i want to modify it a little. when the script copy the selcted text, the text in rtf file is always in helvetica italic. now, i want it to be e.g. in font “Whitney” or let say “Cambria”, and not to be italic.
i googled it a little bit and put some parts in Frederico’s script, but it won’t work. can someone please tell me where is the mistake?
thankx in advance
Quotations&Annotations___Alt-M copy.templatescriptd.zip (47.5 KB)

is it possible to change font of rtf file at all?
i’m looking for two days on internet and i haven’t found solution.

i have finally found the the way to modify font in the script.
in the “append quotation” section, one need to:
make new paragraph with data (theQuotationText & return) with properties {font:“Whitney”, size:14} at end of text of think window 1

i also remove italic font by deleting:
“italicize last paragraph of text of think window 1”

but still have the problems with german words with umlauts (ä, ö, ü) - they appear in lucinda grande font and one must to modify them manually, one by one, because selecting the whole paragraph and changing the font does not apply on umlauts. strange!?

I’m having a problem with the latest DV and OO pro version of the scripts presented here.

The annotation file (whether OO pro or DV) always ends up in the global inbox, not side by side with the pdf referenced.

Am I missing something obvious?

(oh… I should add that the files that I am annotating are indexed. Maybe I need to reread the posts here…)

  • pvonk

First: this script is fantastic, thanks to all who have made it possible.

@pvonk, I’m having the exact same issue, where running the script places the annotation in the Global Inbox rather than in the Inbox of the currently open database.

any thoughts on how to set the location? Many thanks.

Hi All,

these are two really great and extremely helpful scripts! A very big thank you to the creators! Your efforts are sincerely appreciated!

I was wondering if any of the power-users out there might be able to help me out on a little obstacle. When trying to highlight and annotate a specific .pdf file (that is identified as “PDF + Text” in DTPO’s file kind) with the QuoteHighlight&Annotate script, I get following error message: “DEVONthink Pro got an error: Can’t get every text of think window 1”.

Could anyone maybe be so kind to point me in the right direction how I can identify the reason (and possibly a solution) for that error message?

Thanks & best regards,