How, if it’s possible, should we read annotation properties through the scripting interface ?
I have before me a PDF record which, following some text annotations in DT3, has a populated Annotations panel, and returns the value 9 for the following AppleScript snippet:
tell application "DEVONthink 3"
tell front window
tell content record
In the annotations panel, we can see these nine items:
How, if at all, can we read their properties (e.g. text) by script ?
You can get the annotations’ properties with the class
PDFAnnotation from the PDFKit framework using the ObjC bridge. I’ve posted some code in this context here recently.
But: afaik, highlighted text annotations have no text property, only bounding boxes. Which might make it possible to retrieve the text, but I doubt that it’s a fun exercise.
Thanks – thats’s helpful.
And what do we think is the role of the
annotation property of
record objects in the DT3 OSA interface ?
(It seems to return an empty value in this context)
That’s the standalone annotation record, not an PDF’s annotation.
Quoting from the scripting dictionary:
annotation [Record] : Annotation of a record. Only plain & rich text and Markdown documents are supported.