ZotFile - Advanced PDF management for Zotero

  • @JonEP: Thanks for pointing this out. Just corrected this small glitch.

    @alv: I just corrected the function to preview the renaming rules so that it also works when an attachment is selected (I think that caused the '__FILENAME' error you got. That does not solve the problem of missing author data though.

    Both changes will take quit some time until they show up in the official version. They are in 1.6.3 and 1.6.2 is still under review right now.

    @alv2: I am not sure about the max author thing. Either I can't reproduce it or it is intended behavior. If there are three authors and you set max_author=2, the authors will be displayed as 'author1 et al'. As far as I know is that the way citation styles work. Or are you talking about something else?
  • I found a glitch in 1.6.2. Whereas 1.6.0 would give me the file name of the file to be attached, now I get "Do you want to rename and link the file 'undefined' ..."

    It still works though, in that it selects the right PDF.

    BTW, note the language here: it should probably be agnostic wrt linking or attaching (or tell from the preferences what I want it to do). My preferences are set to "use Zotero for renaming" and "attach", so the message seems inapposite. Nothing I can't live with though.
  • @ mark: The bug has been around since 1.6.0 and is solved in 1.6.3, which still takes some time simply because of the review process (currently, 1.6.2 is still under review at Mozilla).

    I don't really get your second comment. Can you elaborate? By the way, you can turn of the user confirmation in the zotfile preferences.
  • The text of the user confirmation popup assumes that I "link" and "rename", whereas I do not link but attach, and do not let Zotfile rename the file. If you could rephrase it so that it is agnostic with regard to what I've chosen to let Zotfile do with the file it would be better.

    I do like the user confirmation as it gives me a quick check.
  • I'm a new user of Zotfile (and Zotero) and i got some problem relative to import of the pdf file when renaming. I explain the situation:

    All my pdfs are arranged in different folder (sort by topic) (file are put in zotero with the attach link to file option)
    So, when renaming, i don't want to "import" them in zotero folder.

    From this link http://www.columbia.edu/~jpl2136/zotfile.html#install, it said to change the value of .import to false. I've tried it but nothing happen when I click rename (file not rename and no error message)

    Thank you for your help

    PS: sorry for my bad english, it's not my native language
  • Try the preferences: Gear menu > Zotfile preferences. There you can conveniently set all options.
  • I have already search through Zotfile preferences. The only way that I've found to make Zotfile rename file without moving it to C:\Users\...\AppData\Roaming\Mozilla\Firefox\Profiles\...\zotero\storage folder was to set a destination folder.

    So the problem i still here, renaming move my file to another folder
  • yes, that is true. Currently, there is no way to rename a file without moving it somewhere (zotfile either imports the attachment into zotero OR moves it to a predefined folder - i.e. destination folder). I will consider adding an option to leave the file at the current position but it will certainly take some time until it shows up in the released version.
  • edited July 27, 2011
    What does your folder structure look like? Can you replicate it using the Zotfile renaming and folder system? If not, I'm afraid you're asking for functionality that is not there yet. Zotfile either (1) organises your PDFs itself or (2) imports them into Zotero. As of yet it cannot rename them yet keep them in the folder structure you want.

    But if the files are linked already, you should be able to use the Zotero renaming feature. Have you tried that?
  • Joscha: thank you for your answer, I look forward next update

    Mark: I can't use Zotfile option to replicate the structure, I sort my file by subject, not by authors or journal (if I could use collection structure it would work, but I've read it's impossible for now)
    Zotero renaming feature work but it's not as good as Zotfile option (I use %a - %y - %s_%v_%e_ format and I add manually the page number at the end)
  • Joscha, thanks again for constantly improving this add-on and for considering all our special wishes. It's definitely worth a donation!
    I'm now using Zotfile 1.6.3 and batch renaming files and moving back and forth is fast and works like a breeze. I just used it to separate my pdfs from other files (html) into different directories by changing the file types and folders in the Zotfile settings and re-running the renaming. Just a small thing I noticed: When I remove a file in Zotero, it does not get removed from the folder. Not sure if this is a Zotero bug/feature or due to the changed storage place by Zotfile, but I wonder if Zotfile could check for orphaned files and delete them. In the reverse direction, I could now (finally!) very easily go through my custom folder and delete e.g. all html files that got imported automatically by Zotero. Does anyone know of a tool to automatically remove links to missing files from the Zotero data base?

  • Glad to hear that you enjoy zotfile.
    It is a zotero feature. zotfile has nothing to do with removing attachments from the zotero library. The change of the storage place also doesn't affect zotero's behavior. What might matter is whether the attachment is imported or linked. I think that zotero deletes imported attachment files from the hard drive when the zotero item is removed from the trash. I am not sure what zotero does with linked attachments once they are removed from the trash. So if you change from an imported to a linked attachment using zotfile, zotero might treat the file differently. But that is clearly a zotero feature (linked attachments, for example, also don't get synced to the zotero server).

    I don't know about a tool to remove links to missing files from the Zotero data base but was thinking about adding an option to zotfile. That would basically prompt the user whenever s/he attempts to rename an attachment that does not exists (currently, the attachment is just skipped).
  • This is a very nice plugin and it almost solves my never ending reference/pdf organization problems. I have my pdfs organized by projects in folders so I can also access stuff from outside zotero if necessary. With zotfile I can move pdfs (or other files) from an indicated folder (e.g. downloads) to a chosen folder and then link the file to the reference listed inside zotero interface. This is fine if I want to put all my references in a special folder and also if I let zotfile further organize the files in subfolders based on some reference metadata. What I haven't been able to accomplish, and wonder if it is possible, is to either provide a destination folder on the fly so that I can choose to store the file-to-be-linked in this project folder or the other; or define some custom metadata directly in the reference so that the associated file is copied to a subfolder named as whatever I want (not only author, journal name, etc). Is there any way to do that. If I could only do something similar I would definitively adopt zotero/zotfile for organizing my already huge pdf collection. Thanks a lot for this great software.
  • edited July 28, 2011
    Felipe, is it possible that you are trying to accomplish something in your file manager (with the PDFs) that might actually better be done in Zotero (with the database of bibliographic items)?

    I also once had a huge collection of PDFs in folders, reasonably well-organized by topic etc. But I realized that Zotero allows me (1) to incorporate all those PDFs as attachments to the bibliographic items they belong to and (2) to organize these items in collections entirely to my liking. The good thing about Zotero collections is that they are virtual and allow entries to be filed in multiple folders. They are also recursive and perfectly searchable for more metadata than the filename could ever contain. That, compared with the tagging system, is really everything I need for organizing my references. I've never looked back to file manager-based way of organizing things.

    Of course, Zotfile allows you to combine the best of both worlds — to some extent. But the degree of customization you're willing to go through seems to me to be best addressed by doing it in your database of bibliographic items, not your pile of PDFs.
  • Hello Mark, thanks for your answer. Yes, I understand your point and I agree. The thing is that I do share these pdfs with other colleagues. In fact some of them are stored in network folders. I work in a research environment in which not everybody uses zotero so the organization of pdfs with the file manager is obligatory. The organization only by author, journal, etc is not sufficient and it should be preceded by a "project name" folder. If this is not possible I might try convincing people of using zotero but this is no guarantied to work since years long habits are hard to change, especially with older colleagues.
  • edited July 28, 2011
    I see you point. I was thinking of a personal library. Collaboration situations are a different matter indeed. You can't force everyone to use a brand new reference manager if they're used to working with good, manipulable files in folders.
  • I am working on something like this for zotfile reader (basically through a > popup in the right-click menu). In this case, user defined project folders are much more useful because that is the only way you can access your pdfs on your tablet. I can't tell right now but if it works out well I might end up porting this functionality to zotfile itself. Bug if so...
  • Ah, yes I would appreciate a simple interface for user-defined folders in Zotfile Reader. I've been using the item type tag for folders, but obviously that is not ideal, and quite limited.
  • Hi there...Great tool!

    But i would like to use the subfolder-organizer with year/first letter of author-name.

    it works for journals...but not for patents. if i use the date-template for the patents(%u?) then i get an "undefined" folder if using this rule with journals...

    can this be fixed in some way please?
  • I just saw that there are two date fields for patents. The 'issue date' and the 'filing date'. Which one is the important one? Would it make sense to define %u as issue date for patents and as year for every other item type?
  • thx for your quick answer :)

    I think the important one is the "issue date"

    I would like to have one "template" witch can use both date fields, since i use the publication year in my subfolder-structure. so your sugestion would make sense :)

    thank you
  • I have made a small change so that %y is now the date for all item types but the issue date for patents. It will show up in 1.6.4, which still takes some time because 1.6.3 is still under review at mozilla (it's a full review so it takes even more time...).
  • @mark: Did you see the user-defined (and collection based) folders in new test version of Zotfile Reader? (there is now also an option for re-pushing)
  • thansk again for your help....

    so %y uses now the date from "journals" as well as the "issue date" of patents? *just want to get it right ^^)
  • %y = year from the 'date' field for all item types
    if item type is patent, %y = year from the 'issue date' field
    (I think that the 'date' field is not defined for patents. If someone tells me otherwise, I will change this rule)
    Is that clear?
  • Well Issue-Date is the fiel that is filles if I import a patent.

    So it sounds perfect to me :) thank you very much.
  • Would it be possible to just "copy" attached files rather than move them and link them? Moving and linking means that the files are not synched and I need synching because of collaboration.

    So, there would be an option which said "just copy these files to directory X". Once copied, they'd have no connection to Zotero but I'd have all my PDFs in a single directory which I can then download to other environments for other purposes?

    Thanks for a great plug-in!
  • Currently it's not possible and I am not sure whether I will add that simply because it's creating multiple copies of a file. But currently, you have two options:
    (a) import the attachments (set destination to 'Attach stored file of file(s)' in the preference dialog) so that they are synced and then create a saved search for all files (or just pdfs) in the zotero storage folder. Setting up a saved search is discussed somewhere in this forum.
    (b) Import the attachments (set destination to 'Attach stored file of file(s)' in the preference dialog) and then misuse Zotfile Reader in background mode to move the files you want to a specific folder while keeping a copy stored in zotero for syncing.
  • edited September 1, 2011
    Here is a new zotfile version that is compatible with Zotero Standalone. It's currently under review at Mozilla so that you will have to install it from here.


    New Features in 1.6.4
    - Compatible with Zotero Standalone

    (for instructions see http://www.columbia.edu/~jpl2136/zotfile.html#install)
    - restore selection after renaming of attachments
    - cleaned preference window
    - %y is now the issue date for patents
    - Bug resolved: Rename Existing Attachment created 2 as a suffix if filename did not changed
  • Joscha,

    You rock! I was just thinking that I wouldn't be able to use Zotero Standalone as my main Zotero tool because there wasn't a version of Zotfile for it.

This discussion has been closed.