In DT3 I’m attempting to create an annotation template for use in the annotations inspector. I placed an RTF in the Annotations Folder with a few placeholders. The placeholders %documentLink% and %longDate% worked as expected. But the placeholder for custom metadata did not.
The custom metadata field is called “Citation” and the identifier is of course “citation”. The type is rich text, but I’ve tried single line text and other types as well. The placeholder offered by the “insert placeholder” contextual menu is “%mdcitation%”. I have also tried “%citation%”.
If I select the template I created from the “New from Template” command in the Annotations and Reminders inspector, the resulting annotation replaces other placeholders with a link and date, as expected, but simply prints the text “%mdcitation%” verbatim. I’ve tried other custom metadata items and had the same result.
Elsewhere in DT3, the placeholder %mdcitation% is recognized as a placeholder. I used custom metadata placeholders in the WikiLinks template, and this works fine.
Hello again, I downloaded version 3.5.1, which, according to the release notes should support placeholders in annotations. I tried this out and found that the standard placeholders, like %recordURL% or %recordTags%, work perfectly.
However, I am not having success with custom metadata, such as %mdpublication% or %mdcitation%.
I found the placeholders I wanted using “insert placeholder” from the context menu. I also tried without the “md” and with the exact capitalization of the field name.
Ok, I think we are talking about the same thing? My original message in this thread goes into more detail about what I did and what I am trying to do…
My custom annotation template looks much like your second image. When I create an annotation file from that template, however, the metadata placeholders are not replaced with data. They remain as “%mdmetadataname%”, for example. However, built-in fields like %recordURL% and %recordTags% work as expected.
Yes, provided the original file I’m making the Annotation file for has data in those attributes. In my example test, I had two of the five, and yes, they populated as expected.
My original file, the one I’m making the annotation file for (the ‘parent’ if that’s okay), is RTF and the annotation file is also RTF. Is that what you were asking?
The parent file has data in the custom meta data fields. The custom annotation template (also RTF) looks like this:
This works: %documentLink%
This works: %recordTags%
This works: %recordURL%
This does not work: %mdpubdate%
Neither does this: %mdpublication%
Nope! %mdcitation%
If I choose the custom template from the “Annotations” menu in Tools → Inspectors → Annotations & Reminders, the resulting annotation file looks like this:
This works: MyRichTextFile
This works: myTag
This works: https://discourse.devontechnologies.com
This does not work: %mdpubdate%
Neither does this: %mdpublication%
Nope! %mdcitation%
Even though the parent file has data in “PubDate,” “Publication,” and “Citation”.
Is there maybe a list for useable placeholders? I only saw one in the manual, but it won’t say how I should write it with %placeholder%.
Also if I understand correctly, there are different placeholder contexts, so they are not generally unified?
I also figured that outside of DT (e.g finder) the created annotation file has the name as the custom template file. Is there a way to change the output title/name like the one in DT?
Of course. When I created an annotation md with my custom annotation template (notes-x.md (x is ascending number)), the new file is named after the filename of my template (notes.md). When I click reveal in DT, the file has the right title but not if I click on ‘show in finder’.
I also found out, that this problem only occurs, when I move the Annotation Folder of the Database in Devonthink to an indexed folder. When I didn’t move the Annotation Folder, the filenaming is also right ‘in finder’.
So is there a way to have my annotation file with the correct name of the corresponding ‘source’ file and at the same time have the Annotation Folder moved to an indexed folder?
Edit: I do not know if it isn’t too offtopic but Exporting the annotations with and without annotations via Annotations & Reminders inspector gives in both scenarios the same pdf with annotations only. Is this maybe a bug? And do I need to use the annotation in the document scope to export a pdf with the actual pdf and the annotation together?