jlegewie / zotfile

Zotero plugin to manage your attachments: automatically rename, move, and attach PDFs (or other files) to Zotero items, sync PDFs from your Zotero library to your (mobile) PDF reader (e.g. an iPad, Android tablet, etc.), and extract PDF annotations.
4.06k stars 282 forks source link

[FR] Pinnable Filenames via Custom Fields #607

Open Servinjesus1 opened 2 years ago

Servinjesus1 commented 2 years ago

I would love the ability to pin a filename, much like Better BibTex's pinned Citation Key (via the Citation Key interpreted key in the Extras field). I envision this being possible by allowing arbitrary field names in custom wildcard definitions, where the Extras field is parsed for this arbitrary field name if it doesn't match one of Zotero's built-in ones. This provides an alternative to %x that plays nice with Better BibTex, which pins citation keys by adding the Citation Key key/value pair, and Zotero's built-in use of this field for putting in unsupported field metadata into an item (e.g. PMCID). The KB article is a little ambiguous about whether arbitrary/custom fields are "supported"1 using this syntax (e.g. Name: Mitochondria Powers Cells). Either way, it would be awesome if Zotfile did, for creating custom wildcards that point to custom field names defined in the Extras field to essentially pin the name of a file to whatever you put in for this field.

For reference, the naming scheme I'm striving for will do something like: Scientist1993-JJ~Mitochondr...house_Cell

by default, but if the field Name exists: Scientist1993-JJ~Mitochondria_Powers_Cells

I've got it down to: {%b~}{ {%1} | { {%2} { %3 | {...%4} } } }/

where %1 would be the custom field Name. If that does not yet exist, default to %2, a regex for the first 10 "interesting" characters of the title2, plus %3, a regex for the last 10 "interesting" characters of the title, if the title is 20 "interesting" characters long, otherwise ...%4, roll up the middle part and keep the last 10 "interesting" characters. To get this done, I would need this Pinnable/Custom Field feature and this feature.


1 The point of this syntax is to give space for unsupported fields. 2 e.g. not conjunctions (and, or, of, ...) or punctuation