Note template customization request
Is it possible to create a "citekey" variable for the note template? Most academics using Zotero with linked notetaking apps (Obsidian, Logseq, Roam) link source pages in those apps using the citekey, so it would be a very useful addition.
Relatedly, is it possible to allow user customization of the "citation" variable? Ideally pdf highlights would be followed by (@citekey, pg. ##). Thanks.
Relatedly, is it possible to allow user customization of the "citation" variable? Ideally pdf highlights would be followed by (@citekey, pg. ##). Thanks.
Annotation citations already include the page label of the annotation.
> When all fields gain a Citation Key field, we can consider it.
Does this mean "when all item types gain a Citation Key field"?
What would cause all fields or item types to gain a Citation Key field? Would this require a Zotero change or a CSL change?
EDIT: I see it was mentioned on the Google group here: https://groups.google.com/g/zotero-dev/c/5be0oTvhLvM
(For CSL, we very occasionally do email amongst a small group of maintainers -- not including Zotero devs -- but that concerns organizational questions; all substantive decisions happen publicly).
It changes the default format “This ist the quote” ([Autor, Year, p. page](Link-to-item)) ([pdf](Link-to-annotation)) to *“This is the quote”* [@Autor-Year, page]-[pdf](Link-to-annotation), which gets close to the citekeys I need, to use Pandoc in Obsidian more seamless.
-- get content from the clipboard
set theClipboard to the clipboard
-- extract quote
set quotedText to do shell script "echo " & quoted form of theClipboard & " | awk -F '“|”' '{print $2}'"
-- PAUSE set quotedText to do shell script "echo " & quoted form of theClipboard & " | awk -F '\\(\\[' '{print $1}'"
-- extract author
set authorRaw to do shell script "echo " & quoted form of theClipboard & " | sed -n 's/.*(\\[\\([^,]*\\), \\([0-9][0-9][0-9][0-9]\\), p\\. \\([0-9]*\\)\\].*/\\1/p'"
-- delete brackets in the beginning & second authors & et. al
set author to do shell script "echo " & quoted form of authorRaw & " | sed 's/^[\\[]//; s/[]]$//' | awk -F ' and' '{print $1}' | awk -F ' et al' '{print $1}'"
-- extract year
set pubYear to do shell script "echo " & quoted form of theClipboard & " | sed -n 's/.*(\\[\\([^,]*\\), \\([0-9][0-9][0-9][0-9]\\), p\\. \\([0-9]*\\)\\].*/\\2/p'"
-- extract page
set page to do shell script "echo " & quoted form of theClipboard & " | sed -n 's/.*(\\[\\([^,]*\\), \\([0-9][0-9][0-9][0-9]\\), p\\. \\([0-9]*\\)\\].*/\\3/p'"
-- extract pdf link
set pdfLink to do shell script "echo " & quoted form of theClipboard & " | awk -F 'open-pdf' '{print $2}' | awk -F '[)]' '{print $1}'"
-- combine the extracted elements to the new format
set formattedAnnotation to "*“" & quotedText & "”* [@" & author & "-" & pubYear & ", " & page & "]-[pdf](zotero://open-pdf" & pdfLink & ") "
set the clipboard to formattedAnnotation
display notification "Annotation successfully formatted and copied to clipboard" with title "Zotero Annotation Formatter"