How to rename PDF files with short journalAbbreviation?

This discussion was created from comments split from: Now available: Zotero 7.
  • How to rename PDF files with short journalAbbreviation?
    For example, does the journal name “Proceedings of the National Academy of Sciences" can be abbreviated as "PNAS"?
  • If you're referring to the new file renaming functionality in Zotero 7, then the {{ journalAbbreviation }} field can be used in the filename template. As long as your metadata contains this information, file renaming will use it.
  • Thanks a lot! I have implement it using the following template:
    {{ publicationTitle replaceFrom="(\s|&|\(|\)|\bof\b|\bthe\b|\band\b|\B[a-zA-Z])" regexOpts="g" suffix="_" }}

    However, how to abbreviate "Journal of Geophysical Research: Solid Earth" as "JGR-SE"?

    It seems need implement replaceFrom and replaceTo many times.
    For example:
    {{ publicationTitle replaceFrom="[\:]*" replaceTo=" - " regexOpts="g" replaceFrom="(\s|&|\(|\)|\bof\b|\bthe\b|\band\b|\B[a-zA-Z])" replaceTo="" regexOpts="g" suffix="_" }}

    However, it does not work.

    Could you give me some suggestions to implement it ?

    Thank you very much!
  • Unfortunately, there is currently no functionality to perform multiple replacements on a single field, but we're considering various options for implementing this in the future.

    For your specific problem, wouldn’t it be more feasible to edit the item's metadata so that the Journal Abbreviation is stored in the Zotero database and use that as the basis for file renaming? Doing this within the template might go a bit beyond what the file renaming functionality was designed for.
  • @tnajdek. Thank you for your reply. There is no Journal Abbreviation for some existing items. As mentioned above, I can rename PDF using the publicationTitle. However, it cannot implement the following function:
    eg. Journal of Geophysical Research: Solid Earth -> JGR-SE
    Could you provide a function or fill this information in some metadata automatically?
    Thanks a lot!
Sign In or Register to comment.