Zotfile Rename based on Collection(s)

Hi,

On the Zotfile page, it is given that rename can be done using Collection's name. But what is the wildcard for that?

I also tried introducing user-defined wildcards in about:config, but it didn't work either.

Basically, the problem is that since "Collection Name" is not a field, I don't know what "keyword" to use in defining a user-defined keyword.

So, how to do it?
  • pretty sure that's not possible. All renaming options are for item-level data. Collections aren't part of that data. I only see this mentioned in one changelog entry, which I assume is a typo. Might refer to the "move to tablet" function or to a different variable.
  • Ohh, is that so :(

    But organizing your files in your filesystem in the same manner as your Zotero Collection should be an obvious choice for any user. I wonder why this feature is not there in the Zotfile.

    Can't it be done using some "hack"?
  • No. Dan explains the basic why not here:
    https://forums.zotero.org/discussion/5301/19/zotfile-zotero-plugin-to-rename-move-and-attach-pdfs-send-them-to-ipad-extract-pdf-annotations/#Item_29
  • Oh.. yeah... since items can exist in multiple collections, that's going to be a problem...
  • I think it would have been better if there was a single-valued "Category" field. That way we could add categories to each entry and then while renaming we could use this field in our pattern to organize our collection in the filesystem with neat folders.

    Currently I am using the "Extra" field for this, since there is no Category field.

    I tried adding Category field by editing the zotero.jar file but it is not showing up currently. I guess I will have to look deeper into the source to achieve this.

    Meanwhile could someone forward my request for adding a single-valued "Category" field in Zotero? This is a much-required field if users want to organize their files neatly in their filesystem.
  • edited November 5, 2014
    If the sole purpose of the "Category" field is to rename and organize files using Zotfile, then you can easily accomplish this using Zotfile's custom wildcard functions. The code below, for example, defines "%C" to refer to the text in the Extra field that appears after the text "Category: " With this in place, set the Move Location settings to organize files based of %C.


    "C": {
    "default": {
    "field": "extra",
    "operations": [ {
    "function": "exec",
    "regex": "Category: *([^;\\n\\r\\f]+)",
    "group": 1} ]
    }
    }


    Given that Zotfile can accomplish the behavior you're looking, I don't think that it's likely for Zotero to implement a new field given that it's a very niche feature.
    I tried adding Category field by editing the zotero.jar file but it is not showing up currently. I guess I will have to look deeper into the source to achieve this.
    You should avoid trying to modify the database structure in the Zotero code. Even if you get the field to display in your local Zotero client, this will break syncing with zotero.org. Frank Bennett, the creator of Multilingual Zotero, needed to use a huge number of workarounds to get additional fields to work with the MLZ client; it's not something that can be easily done.
  • I thought ZotFile does collections now? Is that not right?
  • I missed that feature apearing.

    %c is the wildcard for collection
Sign In or Register to comment.