Summarize PDF Highlights wishlist

Currently, the option allows you to create a MD or a RTF, and only exports text annotations.

Add a third option to generate a PDF (or a Formatted Note), exporting annotations and scribbles. The new PDF will contain all the text annotations as it has now, but will export the page with scribbles as well. Or even better, export each full page with the annotation as well, saving the annotation as original. The new generated PDF will contain only the pages with any added content and perhaps a link to the original PDF page.

Thanks for the suggestion! No such plans so far but noted.

1 Like

I would also like to be able to export not only text annotations but possibly any scribbles on the PDF page as well. Is it possible to enhance the script that is used to summarize PDFs in Devonthink, or to use something along the lines of below linked GitHub repos to be able to extract scribbles as well?

Thank you!

It’s not a script and can’t be customized. But an example PDF containing such annotations would be useful.

Hi there,

is there any chance to change to style of the exported markdown file?

I found this summary of my pdf highlights quite useful, but until today thought about, why the highlighted text from the pdf is also highlighted in markdown (with {== ==}) a lot. Besides highlights only notes could be extracted. So my markdown files are nearly 90 % highlight and 10 % plain. Did I miss something and did not see the main reason why the highlight syntax is useful?

The most other tools which exports highlights uses the blockquote syntax “>” to show it is from another source. This gives me the option to highlight the text again if I want to work further with my markdown file and I find it useful.

I thought about creating an Apple Script to get this blockquote syntax in the exported markdown files with replacing the original highlight syntax, but after some hours of ready through Apple Scripts website it seems to be not so easy as I thought.

Do you see any chance to give the user the option to choose between highlight or blockquote in the near future? :smiley:

There’s always a chance. Does anyone actually prefer the current way?

String operations are notoriously hard in AppleScript. But there’s an alternative:

(() => {
 const app = Application("DEVONthink 3");
const recs = app.selectedRecords();
recs.forEach(r => {
  const text = r.plainText();
  const newText = text.replaceAll(/\{==(.*?)==\}/, "\n\n> $1\n\n");
  r.plainText = newText;
})
})()

This is JavaScript and should work, though I can’t test it right now, because I’m away from my DT installation. It takes the currently selected records (which should be MD files, but this is not checked!) and replaces all text between the highlight markers by a blockquote (see the replaceAll call) fenced by two newlines.

Beware This changes your MD file, and there’s no undo for it. So please test it thoroughly on copies of your files before you run it in production. As always: no warranty.

I haven’t heard any other opinions, good or bad.

Hi chrillek,

thanks for you help but I’m a bit lost how to use it? As part of a (smart) rule or as a scp-file?

Sorry.

Here’s a script @BLUEFROG made and shared that removes this highlight syntax. I don’t like the highlight syntax and wish it wasn’t added. New users of the app I’ve talked to either don’t like it—it especially makes it harder to dump text into Obsidian, where this highlighting is annoying as well. And sharing this script and smart rule is a big hurdle for newbie users who shouldn’t have to worry about that.

New users of the app I’ve talked to either don’t like it

Inclusion of the highlighting was part of the requests for a Summarize Highlight feature.

Open Script editor with a “new” script and select “JavaScript” in its upper left corner.

Copy/paste the script into it.

Then duplicate one or several markdown records in DT, preferably into their own group.

Select these duplicates and then click the right pointing triangle in Script Editor to run the script.

If that does what you expect, you can copy the script to DT’s script folder (that should be explained in the online help unter the heading automation).

You can not use this script in a smart rule due to current limitations in DT which are announced to be lifted in the future.

The current way is not really useful

1 Like

At least if you only use highlighting. But it is IMHO useful if you use also underlining or strike through.

1 Like

Just wanted to chime in and say that I also find the current approach of highlighting the extracted highlighted text to be unhelpful, and would appreciate a way to turn it off. When I do use the Tools → Summarize Highlights → as Markdown feature, I invariably remove all the {== and ==} markup from the text it produces.

1 Like

Thanks so much.

I tried this script and run into the following error:

Is there anything I did wrong?

My workflow contains underlining, bolding and highlighting. But it starts after I exported my highlights from the pdf.

I would propose:

  1. Summarizing highlights from PDF (and maybe webarchive in the future?) to Markdown results in a quote with the > as the syntax.
  2. As mentioned in the blog article about DT 3.7 from April 2021 the highlighting syntax is adjusted from {== ==} to == == and therefore matches the mentioned tools Obsidian and iA Writer. Even the beta editor from Bear switched from :: to ==.

Do you think this is possible?

No, there’s something I did wrong, although I should have known better. Apologies. Please use this line

const newText = text.replaceAll(/\{==(.*?)==\}/g, "\n\n> $1\n\n");

(i.e. append a g after the closing /).
Sorry again – as I said, I couldn’t test it here

The problem with that is that it breaks CriticMarkup highlighting (which is where {== ==} comes from).

DT3 allows previewing CriticMarkup (with a suitable CSS) and it would be a big step backwards to remove a useful internal feature simply because some external editor doesn’t have that capability, I think.

I think some users have already asked for Obsidian to adopt CriticMarkup, so perhaps it would be good to support that request? Otherwise, if any changes are made in DT3, please don’t let them be at the expense of this useful feature!

1 Like

That is incorrect. We didn’t adjust the highlighting syntax from one to the other. We allow use of the alternate syntax without the braces but the CriticMarkup syntax is still in place.

2 Likes