Include `lastCreator` as a field for renaming

Now that Zotero 7 allows for more powerful renaming, it would be great to have access to the last author field when naming files. This was possible in zotfile via `%q` but I don't see it at https://www.zotero.org/support/file_renaming. I do see `citationKey` which maybe could be used together with Better Bibtex once that addon becomes available?

There have been a few related request in the past but they are specifically about sorting by the last author which there is an open issue for here https://github.com/zotero/zotero/issues/1757. While solving that would also solve this since a field can be used for renaming, I'm opening this thread in case there are other solutions just for renaming.
  • edited July 10, 2024
    I found a way to achieve this! The `authors` array can be indexed with negative integers via the `max` parameter, so authors max="-1" will work for including the last author in the file name, nifty! Here is the full example of what I use now which translates to lastAuthor_firstAuthor_year_title

    {{ authors max="-1" suffix="_" case="snake"}}{{ authors max="1" suffix="_" case="snake"}}{{ year suffix="_"}}{{ title truncate="40" case="snake" }}
    It would be helpful if the indexing with negative integers was mentioned at the file renaming help page to make it more discoverable.

    ---

    When using the better bibtex addon, it is also possible to set the renaming rule to just `{{citationKey}}` and then use the bibtex settings to include `authorLast` in the cite key.
  • leaving a comment to draw more attention to cheflo's post. I could not figure out a solution to this and it drove me crazy. Never thought of using the max argument but this is the only Zotero native solution that works to list last author. Hope others can find this!
Sign In or Register to comment.