ZotFile Renaming Bug (Date/Year)

I'm not sure how/if this type of bug report works now, since the ZotFile page refers folks to a specific thread that has now been closed, but here's some undesirable behavior I noticed...

The ZotFile renaming rules state: %y year (extracted from Date field)
I am using: {%a_}{%y - }{%t}
If my Zotero record date is stored in m/d/y format, I get: {%a_}{mmddyy - }{%t}

For example: one dated 10/15/11 renames to "Name_101511 - Blah blah blah.pdf" when I would like "Name_2011 - Blah blah blah.pdf". I really do want just the year in the file name, but there are too many to reformat the Zotero date records.

Has anyone else encountered this problem, and any ideas on how it could be fixed?
  • I should add that it works as expected if the Zotero date format is October 15, 2011. The name resolves to "Name_2011 - Blah blah blah.pdf"
  • Not your question, but any reason you couldn't just let Zotero handle the renaming if you're just using creator, year, and title anyway? https://www.zotero.org/support/preferences/hidden_preferences

    (ZotFile is barely maintained/updated these days, so I wouldn't count on very active bugfixes there)
  • That's a valid point. I use ZotFile to store references on our network server; renaming is only a side benefit. I think I was hoping to approximate my Calibre storage at one point, to see if I could cut down on duplication, but that doesn't work perfectly either. So switching back to Zotero renaming would solve this for me. Thanks, @adamsmith !
  • I'm pretty sure you can use ZotFile's moving with Zotero's renaming.
  • edited August 29, 2022
    You are correct. There's a checkbox to use Zotero renaming.
  • @PNDPermitting: You can fix this issue by changing the preference extensions.zotfile.wildcards.default in the Config Editor to this value:

    {"a": "author", "A": {"field": "author", "operations":[{"function":"exec","regex": "\\w{1}"},{"function":"toUpperCase"}]}, "F": "authorLastF", "I": "authorInitials", "d": "editor", "D": {"field": "editor", "operations":[{"function":"exec","regex": "\\w{1}"},{"function":"toUpperCase"}]}, "L": "editorLastF", "l": "editorInitials", "t": "titleFormated", "h": "shortTitle", "j": "publicationTitle", "s": "journalAbbreviation", "p": "publisher", "w": {"default": "publisher", "audioRecording": "label", "bill": "legislativeBody", "case": "court", "computerProgram": "company", "film": "distributor", "journalArticle": "publicationTitle", "magazineArticle": "publicationTitle", "newspaperArticle": "publicationTitle", "patent": "issuingAuthority", "presentation": "meetingName", "radioBroadcast": "network", "report": "institution", "thesis": "university", "tvBroadcast": "network"}, "n": "patentNumber", "i": "assignee", "y": "year", "v": "volume", "e": "issue", "T": "itemType", "f": "pages", "x": "extra", "c": "collectionPaths", "g": "authorLastG", "q":"lastAuthor", "Q":"lastAuthor_lastInitial", "u":"lastAuthor_lastf", "U":"lastAuthor_initials", "b":"citekey"}

    Here's a related pull request: https://github.com/jlegewie/zotfile/pull/625.
  • Thank you! @qqbb . That's very helpful.

    - Forgive me for another question, but I know just enough about GitHub to get myself into trouble. Does this pull request mean that future downloads of the ZotFile xpi would incorporate your fix, or would we have to edit the configuration each time going forward?
  • I wouldn't wait for the PR to be merged. It's unclear if or when that might happen. So simply open Zotero's Config Editor and change the "extensions.zotfile.wildcards.default" preference. (The PR has the same effect.)
  • Thanks for explaining!
  • Just in case it's unclear: search for "extensions.zotfile.wildcards.default" in the Config Editor, right-click the preference, select "Modify", then paste in the value given above.
  • Got it, thanks. I was more curious about how GitHub worked for pull requests for terminally ill projects like this. I can make the config edits now, but I'm sure I will forget that I did so when I next have to set up a new computer...
  • If you copy over the prefs.js file in your profile directory to the new computer, this preference will be kept.

    https://www.zotero.org/support/kb/profile_directory
Sign In or Register to comment.