Here’s a script that creates individual Markdown notes for annotations contained in one or more selected PDFs:
For each of the PDFs selected in DEVONthink, this script will iterate over its contained PDF annotations and create or update a Markdown record for each markup or text annotation.
The URL of each Markdown record will be set to a deep link that directly points to the corresponding PDF annotation. I.e., clicking this deep link will open the associated PDF and scroll the corresponding PDF annotation into view.
For each Markdown record, the script assigns a color label that matches your annotation’s highlight color.
My script is similar in spirit to @Frederiko’s Annotation Pane script. However, my script doesn’t offer a custom UI to set annotation properties but instead parses the PDF annotations directly.
In addition, the script recognizes some markup in PDF annotation notes. This lets you specify the annotation’s name/title and comment as well as its flagged status, star rating, tags and custom metadata. Example annotation note as supported by this script:
# Your title for this annotation
Your comment about this annotation.
< *** @tag @another tag @:flagged @:metadatakey:Some value
If a DOI was found for a PDF, the script can also fetch its bibliographic metadata and set the custom metadata and/or Finder comment of the Markdown records & their group accordingly.
For further details, please see the script’s README as well as the notes at the top of the script.