Plugin request -- Fill in Journal Abbr field

The research group and clients I work for have a very specific format with which they label files and abbreviate journals in reports. When a report is filed, it must include pdfs of all references, with the file name including a custom journal abbreviation (e.g. Journal of Applied Psychology is "JAP", Psychological Science is "PP").

While this isn't any issue with the in-report citations (I simply made an abbreviations.JSON file with the appropriate abbreviations), it is a huge pain for the attachments, as I have to manually change the Journal Abbreviation field in each reference to include the custom abbreviation.

My knowledge of javascript is limited, so I'm curious. How difficult would it be develop a plugin that could enter values into the Journal Abbr field according to a specified custom list? Could such a plugin be tied to the import process to do so when new items are added via translators or DOIs?
  • All plugins take some time to write, but I don't think this would be particularly hard.
    Depending on how easily that needs to be usable, you could also just run this via the javascript api, sans plugin
    Here's the basic idea:
    it'd need slightly different testing and you'd want to use an array of search and replace terms, but both should be quite easy - if you have a matched list, this should take under an hour.
  • Thanks for this post bwiernik. Please let us know of any advances here. I am confronted with a similar challenge.

    In my organisation (with EndNote as a standard) we store pdf files on a network drive, including the journal abbreviation in the name (generated with the %s wildcard of the ZotFile extension). However journal abbreviations in the file name are requested to be like "JEcol" and so on, i.e. without spaces and points. (File naming convention in order to prevent duplicate files. However imagine what happens if someone will pull his EndNote-database with 2000 linked pdfs into Zotero and ZotFile renames all these pdfs in another way).

    And of course, when I need to make a bibliography in a report or paper, I still want to use a regular style instead (like Medline).
  • edited January 27, 2014
    @MILKLIMuser - you can do that with ZotFile user-defined wildcards in ZotFile 3.1 (currently only available from the version page: since it's not reviewed yet). No need for a separate plugin.

    That said, if a filename already exists, ZotFile will create a separate copy with a number attached to the file, so what you want to do may still not work.

    edit: well, only kind of. You still need to fill the journalAbbr. fiel
  • edited January 27, 2014
    @adamsmith - the custom wildcard feature sounds great. I will try this; thanks!

    I indeed noticed the behaviour of adding a "filename2" file when a file named "filename" already exists.

    I work with links to these pdfs (on network folder). Ideally (in my case), such a duplicate would be detected by ZotFile, checked whether it is actually the same pdf, and in that case the existing file should be linked instead of the new one, which should better not be saved then.
  • I have taken a look at custom wildcards. As adamsmith suggests, it seems that I will only be able (with my limited skills at least) to work from the fields that are provided with zotero items.

    So a customizable journal abbreviation style (like the one I described, thus other then Medline) that can be chosen specifically for the %s wildcard in renaming pdf files with ZotFile would be more useful.

    Probably the simplest way to go now is to manually insert my intended journal abbreviation for the file into the Journal Abbr field, and rerun 'rename attachments' from ZotFile.
Sign In or Register to comment.