I really like the way DT allows you to generate a separate document with annotations for a particular document. Right now I copy the annotations from other PDF readers and paste them into such DT annotation documents, and then I insert backlinks. Is there a way to do this automatically for all PDFs that I import?
@BLUEFROG is it possible to make each annotation a separate document? Usually I annotate books and I like to take notes and tag the notes by topic. I’m not so interested in seeing all annotations by book, I like instead to see all annotations I’ve made about a particular topic from any book.
Actually, there is a new command coming in the next release: Edit > Paste with Source Link. This will allow you to copy and paste into your diverse rich text documents and have a page link for each pasted item.
@BLUEFROG would you be able to share how you made the smart rule? Currently, I am able to search for PDF’s in annotations, but I cannot find a way to invoke the Tools>Summarize Highlights>Markdown. Thanks in advance.
Quoting the relevant part here (for me to remember and if it’s of use to anybody else)
repeat with theRecord in theRecords
summarize highlights of records {theRecord} to markdown in (location group of theRecord) # saves the annotation alongside the Record when running from a smart rule
end repeat
The syntax of this command is not the right one, see description of DEVONthink’s script suite in Script Editor after switching the language to JavaScript:
The correct syntax for summarizeHighlightsOfwould be
app.summarizeHighlightsOf({records: [r], to: "markdown"});
Which you could in part deduce from the scripting dictionary quoted above by @cgrunenberg: The first parameter is a list of records, which translates to an Array in JavaScript. And since you have to pass an Array, using a forEach loop for every single record is a futile.
Less obvious is how to pass these parameters. As you can see (again, from the scripting dictionary, but also from @BLUEFROG’s AppleScript), the parameters are named. This is translated into JavaScript by using an object whose properties are the parameter names and their values are the value you want to pass for the corresponding parameter. Hence:
NoteincludeStandardAdditions is only needed in some cases, notably when executing shell commands or for user interaction methods. And you should use const for all program variables that are not variable to avoid involuntary modifications.