Zotero plugin to manage your attachments: automatically rename, move, and attach PDFs (or other files) to Zotero items, sync PDFs from your Zotero library to your (mobile) PDF reader (e.g. an iPad, Android tablet, etc.), and extract PDF annotations.
Please note that the PR include my previous PR #544.
Currently for a "rename and move" action, it is not possible to specify a user-defined wildcard that use a replace function with something other than a string as replacement. For example, if I want my files to be moved into directories named after my collection names after they have been transformed according to the "every word starts with a capital letter" rule, this is not possible.
To perform the operation described above, the regex and json to be used are the following:
But it is clear that it is impossible to specify what to replace the matches with. So in this PR, I propose the possibility to use as replacement "a string" (the current behavior) or a "js function". Behind the scene, this means that we won't just use string.replace with a string as parameter, but rather, string.replace with a function as parameter (see the js doc).
Thus with this PR, it is now possible to perform a complex operation on a match using this json format:
Please note that the PR include my previous PR #544.
Currently for a "rename and move" action, it is not possible to specify a user-defined wildcard that use a replace function with something other than a string as replacement. For example, if I want my files to be moved into directories named after my collection names after they have been transformed according to the "every word starts with a capital letter" rule, this is not possible.
To perform the operation described above, the regex and json to be used are the following:
But it is clear that it is impossible to specify what to replace the matches with. So in this PR, I propose the possibility to use as replacement "a string" (the current behavior) or a "js function". Behind the scene, this means that we won't just use
string.replace
with a string as parameter, but rather,string.replace
with a function as parameter (see the js doc).Thus with this PR, it is now possible to perform a complex operation on a match using this json format:
Applied to my initial example, this would give :