What the heck is going on behind the scenes with ZotFile
I am having great difficulty understanding the instructions for User-defined Wildcards on ZotFile.com. They are very terse and I get the feeling the author is assuming an entire body of knowledge that I do not have. Is there some place else where I can go to get the background knowledge to understand what all those JSON elements are doing? Are they being passed to some standard JavaScript function that is well documented somewhere? In my searching, I have found other examples of zotfile.wildcards.user configurations (here: https://gist.github.com/jmiserez/e39753f3a31aa36bf00b0234c6fc6b53 and here http://felix11h.github.io/blog/zotero-zotfile-configof) that include keywords/commands/elements that are not even mentioned in the instructions at ZotFile.com. This tells me that ZotFile is using some standardized system or function but the author has just assumed we would all know what that system or function is.
I have no clue what that system or function is!
Can someone please enlighten me?
I have no clue what that system or function is!
Can someone please enlighten me?
This discussion has been closed.
In the syntax, you first specify the name of the wildcard (e.g., on the zotfile.com page, it specifies the user-defined wildcards %1, %2, %3, and %4). You then say how that wildcard should be translated into item metadata.
The first example on the page is the easiest—just give a Zotero field that should be used for all items (e.g., publicationTitle).
The second example shows how to specify a different field for each item type—list the item types with a corresponding field for each, and be sure to include a "default" entry for item types not listed.
The third example shows that you can use Regular Expressions for more complex operations (e.g., extracting part of a field, replacing part of a field with other text). Regular expressions are a somewhat complicated programming concept. You can learn more about them and practice using them here: http://regex101.com/
The fourth example shows that you can combine 2 and 3 into one wildcard—using a different regular expression for different item types.
Thanks.
If you want to know more, I recommend digging into the renaming code in Zotfile at https://github.com/jlegewie/zotfile and the Zotero developer documentation (https://www.zotero.org/support/dev/start).
The alternative would be to just not offer them, which I hope you'd agree would be worse.
So you can either try to play with the wildcards, figure out what you can, and then ask specific questions which we'll try to answer, or you can just use Zotero's or ZotFile's regular renaming features the way 99% of users do happily. What you can't do is demand that people spend their time walking you through advanced&technical config and then be offended when they don't.
Edit: I just had a look at the Wildcard documentation on zotfile.com and while it's indeed relatively terse, once you follow the links, every single element I can see, including in the examples you link to is, in fact, defined.