Attachment File Naming Conventions
Hello -
Is there any way to set up different automatic attachment file-naming conventions for different types of media?
My usual manual file-naming protocol, which I've used for years:
Book:
Author(s) - Title [publisher, edition, year].pdf
Anthology, Encyclopedia, Reference Work: (omits author(s) and editor(s)):
Title [optional publisher, edition, year].pdf
Article:
Author(s) - "Title" [journal or anthology, year].pdf
The quotation marks, for example, are used only for articles, so this makes easy quick differentiation of articles from books. That standard is derived from the use of quotation marks for article titles within citations in Chicago style. Leaving off the authors for certain types of works (reference works, anthologies, encyclopedias) also makes those easy to identify at a glance.
Presumably such is impossible with Zotero or any add-ons? I've been experimenting with Zotfile as well, but it only seems to allow a single naming convention for all of the above categories of media. Zotfile also still seems to default to moving the files into the Zotero database when re-naming, rather than just re-naming linked files and leaving them in their place.
(Note that I use my own file organization system, not Zotero's built-in database. I organize the files topically and thematically on the computer; thus I use Mac's Finder and folder hierarchy to organize these files. I use aliases if a given article falls under multiple topics and themes. So for example an article on Skepticism would be filed in Philosophy:Skepticism with an alias in Philosophy:Epistemology; if the author has a folder of his/her own, then either the alias or original would also go in that folder; and so on.)
Any suggestions appreciated.
Best regards,
ZM
Is there any way to set up different automatic attachment file-naming conventions for different types of media?
My usual manual file-naming protocol, which I've used for years:
Book:
Author(s) - Title [publisher, edition, year].pdf
Anthology, Encyclopedia, Reference Work: (omits author(s) and editor(s)):
Title [optional publisher, edition, year].pdf
Article:
Author(s) - "Title" [journal or anthology, year].pdf
The quotation marks, for example, are used only for articles, so this makes easy quick differentiation of articles from books. That standard is derived from the use of quotation marks for article titles within citations in Chicago style. Leaving off the authors for certain types of works (reference works, anthologies, encyclopedias) also makes those easy to identify at a glance.
Presumably such is impossible with Zotero or any add-ons? I've been experimenting with Zotfile as well, but it only seems to allow a single naming convention for all of the above categories of media. Zotfile also still seems to default to moving the files into the Zotero database when re-naming, rather than just re-naming linked files and leaving them in their place.
(Note that I use my own file organization system, not Zotero's built-in database. I organize the files topically and thematically on the computer; thus I use Mac's Finder and folder hierarchy to organize these files. I use aliases if a given article falls under multiple topics and themes. So for example an article on Skepticism would be filed in Philosophy:Skepticism with an alias in Philosophy:Epistemology; if the author has a folder of his/her own, then either the alias or original would also go in that folder; and so on.)
Any suggestions appreciated.
Best regards,
ZM
But they require some technical know-how to set up
I thought it was possible to rename linked files without moving with Zotfile with some setting, but I may be wrong on that one.
Seems to be an ongoing problem:
https://forums.zotero.org/discussion/68517/zotfile-renaming-linked-files-but-not-moving-them
https://forums.zotero.org/discussion/35932/zotfile-renaming-attachments-without-moving-them
Regardless, it would be great if Zotero itself included such customization of the re-naming format directly, in its own file re-naming capability. Ideally, if one could also specify either a global renaming format, or various renaming formats per item type (as in Zotfile).
Generally, it’s a bad idea to use quotes of either kind in file names. I recommend against it.
I had tried that solution recommended in a thread, of setting linked field blank, but still no luck. The file was still moved as well as re-named.
What is the concern with quotes in file-names?
Any recommendation on an authoritative up-to-date list / guideline on file-naming, especially of "forbidden" characters? I see various such online as I search just now, but they all seem to differ in the details. (Question marks and colons, which often appear in article titles, certainly can pose problems even for the Mac file system).
US NIST I believe still recommends only (ascii) letters and numbers, hyphens and underscores, but that's more restrictive than necessary for most purposes. Definitely avoid colons, though.
So maybe single-quote marks would be a good way I can still differentiate articles from books (i.e. putting quotes around article titles in file names, but not around book titles). Or I might give up on that differentiation, as it would still require manual re-naming...at least until Zotero might allow differing attachment naming string formats per item type. So meanwhile perhaps I should just use a single naming convention for all file types, which would allow me to use Zotero's renaming.
Also, a feature request for the batch re-naming functionality:
Zotfile allows selection of (one or multiple) top-level Zotero items (e.g. books, articles, etc.) and then applying its rename functions. Zotero itself seems to only allow selection of the PDF itself, within the top-level item, which is a bit more tedious as it requires opening up each item, selecting each PDF one by one. Perhaps Zotero could allow top-level selections of the items, and then the contextual menu would appear for the top-level items.
{
"W": { "field": "title",
"operations": [ { "function": "exec", "regex": "([^:.?!]+).+$", "group": 1 },
{ "function": "replace", "regex": "<i>|<\/i>|<b>|<\/b>|<sup>|<\/sup>|<sub>|<\/sub>|<span[^>]+>|<\/span>", "replacement": "", "flags": "g" },
{ "function": "replace", "regex": "[\\\/()~!@#$%^&*{«»„““”‘’|….,;`^<>'}+:?®©]*", "replacement": "", "flags": "g" } ] },
"B": { "default": "publicationTitle",
"artwork": "medium",
"audioRecording": "medium",
"bill": "code",
"bookSection": { "field": "bookTitle",
"operations": [ { "function": "exec", "regex": "(^.{0,30}).+$", "group": 1 } ] },
"case": "court",
"computerProgram": "itemType",
"email": { "field": "itemType",
"operations": [ { "function": "replace", "regex": "\\w+", "replacement": "Personal communication", "flags": "g" } ] },
"hearing": "committee",
"instantMessage": { "field": "itemType",
"operations": [ { "function": "replace", "regex": "\\w+", "replacement": "Personal communication", "flags": "g" } ] },
"interview": "itemType",
"journalArticle": { "field": "journalAbbreviation",
"operations": [ { "function": "replace", "regex": "\\.+", "replacement": "", "flags": "g" } ] },
"letter": { "field": "itemType",
"operations": [ { "function": "replace", "regex": "\\w+", "replacement": "Personal communication", "flags": "g" } ] },
"manuscript": "type",
"map": "type",
"patent": "applicationNumber",
"podcast": "itemType",
"presentation": { "field": "extra",
"operations": [ { "function": "exec", "regex": "Abbr: *(.*)", "group": 1} ] },
"report": "type",
"statute": "code",
"thesis": { "field": "thesisType",
"operations": [ { "function": "exec", "regex": "([^ ']+)", "group": 0 } ] },
"videoRecording": "medium"
},
"Y": { "default": "issue",
"patent": { "field": "filingDate",
"operations": [ { "function": "exec", "regex": "([A-Z])[a-z ]?[^0-9]*([0-9]{4})$", "group": 2 } ] } },
"S": { "default": "issue",
"patent": { "field": "filingDate",
"operations": [ { "function": "exec", "regex": "([A-Z])[a-z ]?[^0-9]*([0-9]{4})$", "group": 1 } ] } }
}
It does seem more trouble than it's worth to script program such a system of variable names. I'll try to make peace with the idea of a single name format for all items.
https://www.zotero.org/support/preferences/hidden_preferences#translator_preferences