Template scripts for Annotation templates?

In DEVONthink 3.7, is it possible to create annotation templates that are scripts, like other templates can be? I.e., would creating a .templatescriptd type of template work for an annotation template placed in the Annotations.noindex directory?

No, smart templates arenā€™t supported as Annotation templates.
To what end?

To what end?

Here are two reasons:

  1. DEVONthink supports a number of template placeholders, but there are still other things Iā€™d like to put into an annotation template for which there are no predefined placeholders. For example, if I wanted to create an annotation template in markdown that included the highlights from a PDF being annotated, the only way to get the annotations is currently to use the AppleScript command summarize highlights of. I could implement some AppleScript code to create a custom placeholder if annotation templates could have the same form as regular templates.

  2. I use Zotero for reference management, and I index my folder of Zotero papers using DEVONthinkā€™s indexed folder mechanism. I also use a software utility I wrote (Zowie) to write the Zotero record URI for each PDF file into the Finder comment of the PDF file, which makes it accessible from DEVONthink. I would like to write an annotation template for reading notes, and create a custom placeholder to insert the Zotero link into the annotation document.

Those are two limitations of the current annotation scheme in DEVONthink that could be remedied by allowing annotation templates to have the same scriptable form as the other templates.

Sounds like things very custom to your setup. Development will have to assess the feasibility and broad appeal of this. Thanks for your patience and understanding.

Perhaps it seems like this is a custom/advanced use case, but on the other hand, I think it could be argued that the current arrangement in DEVONthink is conceptually inconsistent. Hereā€™s why. Non-annotation templates can be single files, or template packages, or smart templates, and the user manual describes how they work. The manual even suggests inspecting the sample ā€œProjectā€ smart template for ideas and inspiration. So, when creating an annotation template, it doesnā€™t seem unnatural to think they could be like any other kind of template in DEVONthink ā€“ either a single file, or a template package, or a smart template. But currently, theyā€™re not. The situation feels like an exception (ā€œyou can do such-and-such here but you canā€™t do it thereā€), which usually leads to more complexity for users and often more technical debt in the software implementation.

Anyway, thanks for considering it!

2 Likes

I agree fully with your questions / needs @mhucka. Wondering how youā€™re currently solving this. Iā€™m thinking of an alternative approach circumventing the default way to create annotations, but rather always creating them via Applescript. My main ā€˜problemā€™ is how to do that on mobile. But Iā€™m thinking that could be solved with iOS shortcuts because basically all my Annotations are Markdown files on iCloud.

Can you clarify what you mean by this, including screen captures, if possible?

@BLUEFROG thereā€™s nothing really complex: I basically use Markdown files as annotations for clipped web content (as PDFs). So every PDF has basically an accompanying .md file. In the screenshot theyā€™re all in the same folder, but Iā€™m moving them out to a separate folder. Iā€™m using my annotations also in my Obsidian vault as a starting point for writing notes.

Thanks. Thatā€™s helpful to see (and neednā€™t be complex) :slight_smile:

So youā€™re using DEVONthinkā€™s Preferences > General > Annotations: In same group ?

Yes, I am now (these annotations were created outside of DT btw), but Iā€™m going to move to ā€œIn shared groupā€. I had hoped it would also work with an Indexed folder ā€œAnnotationsā€ but unfortunately that doesnā€™t seem to work.

What part doesnā€™t seem to work? It seems it should, technically speaking.

Iā€™ve added an Indexed folder named ā€œAnnotationā€, but when Iā€™m creating an Annotation via Annotation ā†’ New from Template it creates the annotation in a new non-index group with the same name (see screenshot)

image

With some more experimenting the following workaround works:

  1. Create an indexed folder
  2. Move the Annotations folder created by DT to the indexed folder (deconsolidate)
  3. Move the Annotations folder out of the folder from (1)

Now new Annotations will show up in the indexed folder ā€œAnnotationsā€

Iā€™m trying to set my annotations folder to an indexed folder in the root of my database, but I can only get it to work as a subfolder of an indexed folder. Is this possible in any way @cgrunenberg?

Thatā€™s not possible, the only way to convert internal items to indexed items is to move/create them to/in indexed groups.

IMHOā€¦
This is sounding like a bad idea, in general.
Itā€™s best to leave things where DEVONthink puts them for best performance, to avoid unexpected problems from unsupported behavior, and to not flummox support who will not know things are not set up in the default way.

A post was split to a new topic: Automate creating an Annotation file in DEVONthink To Go