file rename syntax examples/help
the codes for renaming files are too complicated for my simple brain.. I always used Zotfile, and it was very easy to arrange it like this:
In the case of one or two authors my filename would end up like:
author1 author2 year - title - CallNumber.extension
In the case of more than two authors:
author1 author2 ea year - title - CallNumber.extension
The CallNumber was only the first part of the call number, I had to edit that manually
And all files were renamed, not only pdf. I use Zotero also for a lot of docx's.
If anyone could help or redirect me to examples, that would be much appreciated!
In the case of one or two authors my filename would end up like:
author1 author2 year - title - CallNumber.extension
In the case of more than two authors:
author1 author2 ea year - title - CallNumber.extension
The CallNumber was only the first part of the call number, I had to edit that manually
And all files were renamed, not only pdf. I use Zotero also for a lot of docx's.
If anyone could help or redirect me to examples, that would be much appreciated!
{{ if {{ authors match="[^,]+,[^,]+,[^,]+" }} }}
{{ authors max="2" suffix=" ea" }}
{{ else }}
{{ authors }}
{{ endif }}
{{ year prefix=" " }}
{{ title prefix=" - " }}
{{ callNumber prefix=" - " }}
It's generally quite straightforward, except there is currently no easy way to append a suffix only if the number of authors exceeds a certain limit, so the syntax above uses regex matching (lines 1–5). We're planning to simplify this a bit in the future. There is a list of common file types to select in the preferences, but
docx
is not on the list at the moment. It can, however, be added using the advanced preference editor. Go to Preferences -> Advanced -> Config Editor. In the window that appears, search forautoRenameFiles.fileTypes
, edit the value, and append the following type after a comma:application/vnd.openxmlformats-officedocument.wordprocessingml.document
This will enable file renaming for
docx
. You might also want to appendapplication/msword
(again, separated with a comma) to includedoc
.Strangely enough, in the preview (in settings), the Call Number is shown. But on the actual file change, it does not add the Call Number. Any idea why?
I'm not very fond on special characters in file names. Is it possible to remover the comma (,) between the Authors? I tried messing with the comma's in the scripts, to no avail.
And it would be great if special characters were replaced by regular one's: ö, or ó -> o, etc. That was also a very nice Zotfile feature.
join
parameter. For example, to use just a space character to separate consecutive authors, replace the second line in the above template with the following:{{ authors join=" " max="2" suffix=" ea" }}
It's currently not possible, but we've had this request before and may add this feature in the future.The comma to space is strange: It works with > 2 authors, but not with <3 authors. In that case still the comma is used.
Something else has changed: names can only be changed right-clicking on the pdf. Not on the parent. That generates extra clicks, but more important: it seems impossible to initiate this action on more than one file at once.. I used to select a range of entries and let Zotfile do the job. No more. That's really a setback. Bug?
Again thank you for your time!
jasper
{{ authors join=" " }}
See: https://forums.zotero.org/discussion/comment/480572/#Comment_480572