Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional renaming options #25

Closed
jlegewie opened this issue Feb 11, 2012 · 12 comments

Comments

Projects
None yet
4 participants
@jlegewie
Copy link
Owner

commented Feb 11, 2012

  • avoid missing fields and their following separator
  • authors' given names initials, first name
  • day and month of publication date
  • optional wildcards
  • customize what replaces the ":" or "."?"

"renaming rules for the authors' given names initials and for extracting day and month from the publication date."

optional renaming patterns
"I have been trying to format renaming pattern and run into a problem. Is there a way to make something optional? In Zotero renaming patterns { } are used with the intention to include only if this field is not empty. Is there anything like that in Zotfile? The problem is when I add %v and there is no volume number for certain publications, I end up having two spaces in the file name."

" would it be possible to rename the file with even more options? and here I am thinking about renaming files with "Last Name, First Name," (or even "Last Name, Initial of First Name") since quite a few of my references share very common last names… "

"would it be possible to customize what replaces the ":" or "."?"

@jlegewie

This comment has been minimized.

Copy link
Owner Author

commented Feb 14, 2012

"I would like to know if you still consider to implement a feature which I think was already suggested, namely to avoid missing fields and their following separator. This for sure is a detail and not a bug. It would however be a nice perfecting, especially when one is using Zotero for managing information for which lots of metadata are missing."

@zeliboba

This comment has been minimized.

Copy link

commented Mar 29, 2012

few more suggestions:

  • lower case all words
  • allow user script/functions to create the title, this might fulfill any naming conventions including the one above.
  • allow choosing the folder instead of (or together with) predefined field of 'custom location' + 'subfolders', for example I sort papers by subject, with can only be specified by me.
  • instead of 'add user input to filename', please allow to edit the generated file name manually. this will help a lot if any combination of options does not fulfill your naming convention.
@jlegewie

This comment has been minimized.

Copy link
Owner Author

commented Mar 29, 2012

Thanks for the suggestions! I will consider them when I work at zotfile again, which (unfortunately) might take while.

On Mar 29, 2012, at 7:56 AM, zeliboba wrote:

few more suggestions:

  • lower case all words
  • allow user script/functions to create the title, this might fulfill any naming conventions including the one above.
  • allow choosing the folder instead of (or together with) predefined field of 'custom location' + 'subfolders', for example I sort papers by subject, with can only be specified by me.
  • instead of 'add user input to filename', please allow to edit the generated file name manually. this will help a lot if any combination of options does not fulfill your naming convention.

Reply to this email directly or view it on GitHub:
#25 (comment)

@Midnighter

This comment has been minimized.

Copy link
Contributor

commented Jan 6, 2013

To add to the missing fields, it'd be great to have a wildcard syntax similar to the following:

[%s|%j]

so that the filename contains either the journal abbreviation or the full journal name lacking that information, the brackets may not be necessary. I'm not a Javascript programmer but if you point me to the function where this action is performed I can try to implement it.

@jlegewie

This comment has been minimized.

Copy link
Owner Author

commented Jan 6, 2013

I would be happy about any pull request. The relevant function is replaceWildcard in the zotfile.js file, which takes two arguments: the zotero item and the renaming rule and as defined in the options (a string). The part that is relevant for you starts around line 788.

Make sure to use the most recent version on github for your changes and not the current release.

@Midnighter

This comment has been minimized.

Copy link
Contributor

commented Jan 6, 2013

I made some modifications that should be sufficient but when I download the zip file and follow the unpack, repack, rename method to install it (with both this development version and my fork), firefox complains that the add-on appears to be corrupted, any clues?

@jlegewie

This comment has been minimized.

Copy link
Owner Author

commented Jan 6, 2013

I am not sure what the problem is but the instructions on one of these pages might solve your problem (just hits from google search "firefox add on create xpi file"):
https://developer.mozilla.org/en/docs/Extension_Packaging
https://developer.mozilla.org/en/docs/Creating_XPI_Installer_Modules

@Midnighter

This comment has been minimized.

Copy link
Contributor

commented Jan 6, 2013

Should I open a pull request already in order to move the discussion there? Anyway, I solved the packaging problem and will add a note to the readme. Right now, using the development version of your master branch, I get the following error when accessing the zotfile preferences:

XML Parsing Error: error in processing external entity reference
Location: chrome://zotfile/content/options.xul
Line Number 4, Column 62:<!DOCTYPE window SYSTEM "chrome://zotfile/locale/options.dtd">

I use Firefox 17.0.1 on Ubuntu

@jlegewie

This comment has been minimized.

Copy link
Owner Author

commented Jan 7, 2013

Yes, you can just open a pull request. Did you consider looking at some of the other additional renaming options discussed above? It would be nice to combine your proposal to use | with optional wildcards. In Zotero renaming patterns {...} are used with the intention to include only if this field is not empty. Maybe a syntax like {_%s|%j} would be nice because it resembles Zotero's syntax. In that case, zotfile should use _AJS (_%s) or _American Journal of Sociology (_%j) if %s is empty or nothing if both are empty. I haven't actually checked how the wildcards work in Zotero but I think they work like that, no?

I know about the error and informed the person who added the localization of zotfile. Thanks!

@jlegewie

This comment has been minimized.

Copy link
Owner Author

commented Jan 7, 2013

Also, it might be much easier to test your chances with a working preference window because you can change the renaming pattern and preview the result. So maybe it makes sense to temporarily use a version before I merged the pull request. I think this one created the problem: 0ae12f4

@gracile-fr

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2013

@jlegewie

This comment has been minimized.

Copy link
Owner Author

commented Jan 14, 2013

gracile-fr, I just added two additional wild-cards for author initials (%I) and pages (%f).

I will close this now after merging Midnighter's pull request. For additional stuff, please open new issues.

@jlegewie jlegewie closed this Jan 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.