ZotFile - Advanced PDF management for Zotero

  • From: jkukavica1 "@Bellthorpe Has the issue of truncating highlights been remedied after changing to Acrobat? I have been having the same issue with Preview".

    No problems at all with Acrobat. And I find its search feature much better. So I'll ditch Preview for this purpose, although I still use it when needing to delete/reorder/merge pages.
  • @Bellthorpe You made my day. Thanks!
  • Hello everyone, and sorry for my English.
    I am using Zotfile to classify my pdf library, and I have a question. By default, Zotfile allows you to replace blanks with underscores by checking the "Replace blanks" option.
    I have read several recommendations on this, which advise the use of dashes instead of underscores to name files:

    (in the comments, they cite ISO 8601)




    Therefore, I would like to know if there is any way in Zotfile that would allow the blanks to be replaced by dashes ("-"). In the future, if I am allowed the suggestion, it would be interesting to have the option of choosing underscores ("_") or dashes ("-") to replace blanks.

    Thank you, and thank you for developing and improving this plugin.
  • edited November 9, 2018
    Hi folks

    I use zotfile to rename attachments and move them into a cloud folder ...
    I use my own renaming convention: {%a_}{%y_}{%t}.

    This works well when there is one attachment, but if there are two, then they both appear in zotero with the same name, although two files appear in the file, so we have, e.g.

    Paper title:

    appearing in Zotero, and


    appearing in the folder.
    (This all on MacOS using the latest zotero.)

    I cannot get to the second pdf file from within zotero ... clicking on either of the the attachment names simply gives the first (not suprisingly). Obviously I can get at them from the file system.

    Is this a bug, or have I set this up wrong somehow?

    Thanks in advance,

  • @santiago.villaperde -- You can definitely change the character between elements to - by changing the renaming format, but I'm not sure if you can change what ZotFile does within elements.

    FWIW, the recommendation for hyphens over underscores only refers to files on the web (where google prefers the former). And you're misreading at the first post you link to: ISO8601 is only about time & date, so they refer to the fact that dates should be in the form YYYY-MM-DD this has no bearing otherwise on file names.
  • @b.n.lawrence
    Is this a bug, or have I set this up wrong somehow?
    Pretty sure this is a bug. This used to work correctly.
  • edited November 14, 2018
    (So, all Zotfile questions go in this one thread?)

    1. How can I setup Zotero and Zotfile such that: When I add an item using Zotero's browser connector, Zotero will download the associated PDF to a folder watched by Zotfile, and then Zotfile will rename the PDF, move it to a custom folder, and attach a link to the item just added in Zotero?

    2. Can I have Zotfile rename such that (a) the first alphabet of each word in the journal name is used (b) only some parts of the title are used with a dash separating each word?

    Haugen, M. J., G. A. Bishop, A. Thiruvengadam, and D. K. Carder. Evaluation of Heavy- and Medium-Duty On-Road Vehicle Emissions in California’s South Coast Air Basin. Environmental Science & Technology, 2018. https://doi.org/10.1021/acs.est.8b03994.

    Thus, above item would have a PDF renamed as:

    My current renaming rule is:

    And that produces a PDF name of:
    Haugen_2018_Environ. Sci. Technol._Evaluation of Heavy- and Medium-Duty.pdf

  • 1. I don't understand the first part of this. The way ZotFile works is by taking files downloaded to Zotero (storage) and moving+linking them. How does the watched folder play into this? The functionality you describe (minus the watched folder) is possible simply by setting up a custom location in the general tab of ZotFile.
    2. At least not with reasonable ease. Maybe you could get a custom wildcard to do this, but it'd have to be pretty involved.
  • 1a. It's possible I am assuming some automatic Zotfile functionality that does not exist or not describing my intended workflow correctly. Currently, I (a) save an item via the browser connector, (b) manually download the PDF to my custom folder - C:\Users\username\Downloads\Firefox, (c) go to the item in Zotero, right-click and ask Zotfile to attach the latest downloaded PDF as a link. I am wondering if all three can happen in one-click. Maybe you are suggesting that I let Zotero automatically download the PDF to my Zotero/storage as "attached copy of file" and then have Zotfile do the rename and move? So that brings it down to two steps from the current three steps?

    1b. I also have many hundreds of items in Zotero for which I have not downloaded the PDF. What the best way to download the PDF, rename, and attach as link for these already existing items? Should I use the "Find available PDF" function from the right-click menu, let Zotero do it's thing, and then use Zotfile to rename and move?

    Note: For both 1a and 1b, I am trying to avoid sending anything to my Zotero/storage folder since ultimately I want everything to be attached as a link. And I suspect sending to the storage folder first and then moving the PDF will still leave behind a folder with no purpose. Or maybe Zotero in any case has a folder for each attachment even when it is attached as a link? Currently I have a couple thousand folders with only two files in each (.zotero-ft-cache and .zotero-ft-info).

    2. Is the journal name part difficult or the title part or both?

  • 1a) Just have Zotero download the metadata _with_ PDF and have Zotfile set up to rename & move automatically. The file will technically briefly be in your storage folder. I'm not sure why you think having the ft-cache and ft-info files are a problem -- they're needed for full text indexing, and I think Zotero would create them either way.
    1b) yes, that's right. ZotFile won't auto-move PDFs retrieved that way, so you'll need to do that manually via right-click, but you can do so in batch

    2. both, probably the title is harder, but both require significantly changing the string in question.
  • 1a. Will try and report back if I have issues

    1b. Guess what, it all happened in one step! I selected a bunch of items, right-clicked and selected "Find Available PDFs". The PDFs were download, renamed per Zotfile rules, moved to my PDF folder, and attached as a link.

    2. Okay, thanks.
  • Is it possible to configure that the moved files are automatically deleted (and the directory if it is empty) when i delete the record?
  • Hi,
    I was really excited to start using Zotfile, but for some reason it doesn't work:
    I've created a folder on my desktop to which I download pdfs. I've defined that as my source folder and have defined another folder as the target folder.
    Zotfile doesn't do anything. It doesn't scan the source folder, doesn't update Zotero and doesn't move things to the target folder. What should I do?
    The error ID is 917498325
    I'm using Zotero 5.0.58 on a Mac.
    I'm using the latest Google Chrome
    I'm using Zotfile version 5.0.9
    Thanks in advance...
  • Occasionally, zotfile will not rename and move a pdf I attache, once in about every 20 cases. I just tried one with "Attach stored copy of file", and it did not move it, but it did rename it (and thus I get the red pdf symbol, instead of the gray link one). Tried the same pdf twice more, and both times it was neither renamed nor moved.

    When this happens, the error log usually (but not always?) shows the following:

    [JavaScript Error: "this is undefined" {file: "resource://gre/modules/osfile/osfile_shared_allthreads.jsm" line: 1265}]

    However, when I right click on the pdf (in red), and select Manage Attachments/Rename Attachments, everything works as expected.
  • I'm a little surprised by the fact that there's no "add new ITEM from source folder" function. I'd think that's a much more common workflow than manually creating an entry and attaching the download to it.

    Happy to hear why I'm wrong, though.
  • @dsjstc The best way to add items to your Zotero library is by using the Save to Zotero button in your browser.

    Zotero will also automatically retrieve metadata for PDFs when you drag them from your computer’s file system to Zotero (though, again, the best way to import is using the browser button from the publisher webpage).
  • edited December 26, 2018
    Is there anyway for Zotfile to extract typewriter/textbox annotations from PDFs? Right now, Zotfile ignores these annotations, though it works flawlessly for highlighted text and for text inserted via pop-up comments. With this function, it would work perfectly for my workflow!

    Thank you in advance, and Joscha thanks for writing such a useful tool!

    (I tried searching this forum post and could only find a similar discussion from 2012 where Joscha states "sorry, I don't have any plans to add the extraction of other annotation types right now..." at https://forums.zotero.org/discussion/5301/zotfile-advanced-pdf-management-for-zotero/p13).
  • It would be possible, but currently Zotfile is only written to extract underlines, highlights, and pop up comments. The Zotfile developer would likely be very open to a pull request from the community with support for other annotation types.
  • @bwiernik

    Thank you for your reply. Does that mean you think Joscha (ZotFile Developer) would be open to incorporating code written by someone else to provide this functionality?

    If so, I've tried looking through the source code a bit. I don't have much of a programming background, but I figured out at least how to edit and test the code from the github page.

    I tried adding FreeText to the line var SUPPORTED_ANNOTS = ['Text','Highlight','Underline'] in the two places it appears (getPDFAnnotations.js line 23 and extract.js line 4) but that did not do the trick.

    I don't fully understand the code or see what is limiting the extraction to underlines, highlights and popup comments. Honestly, I don't think I really have the programming skill to write this myself! Is there anyone else actively developing for ZotFile?
  • Quick question. Finally decided to post here after trying to look on google for an answer.

    I recently realized zotfile is not keeping my folders updated as I add more references in. For example, I have a folder full of pdf's from journals. I drag and drop them into zotero, however no files are moved and no files are renamed. On top to this, I need to manually select all files in zotero, right click, and go rename in order for anything to be done. Even then - only files that were renamed were moved (some of the files metadata hasn't been picked up, so none of these were moved). I have quite a few pdfs and am constantly adding more in so it's getting crazy to try and keep everything together. Usually I use the connector on chrome to add references in but files havn't been syncing properly so I needed to resort to the drag and drop method.

    I've had to go through my references multiple times now just to double check nothing got copied wrong. What can I do to fix this? Is this just an inherit problem with zotfile/zotero? I'll admit im a newb to zotero, so i'm hoping to learn what i'm doing wrong or what I can do to correct this. Thanks!
  • Hi Mattmiller,
    it is not clear why you are posting this in the zotfile thread. It seems what you describe is a problem with zotero, and it is not clear to me why you drop pdfs to a folder in the first instance. The way to go is to either:
    -drop files directly into zotero, then right click and select "pdf metadata retrieval". You can select multiple pdfs in zotero and do the metadata retrieval for all of them in one go. But you should alway move files to zotero, not a folder.
    I do not understand what you mean by "only files that were renamed were moved"
    -Depending on how you get your pdfs in the first instance, most webpages where you download pdfs from, such as google scholar, or JSTOR have the option to directly download citation data and pdfs in one go into zotero. To do so, click on the yellow folder (if you are on a page with multiple items) or the blue page sign in the browser.
  • Hi all!
    Is it possible to share with tablet PDFs that are stored in Group Libraries?
    I've been trying but the option Send To Tablet does not apear... only in the personal collection.
  • Has anyone on the zotfile side looked into this bug with moving linked attachments back to zotero storage?

    I'm interested as this would help for using zotfile with group libraries. If the feature was slightly extended with a "move back to zotero storage" command rather than just running the standard move/rename command, even better - that would make it super easy to use linked attachments for most files in my personal library, then transfer them back to zotero storage before adding to a group library!
  • Dear Sir! My zotero desktop lack zotfile, and I couldn't download it to extract notes from PDFs. What shall I do?

  • Right click on the download link here: http://zotfile.com/, choose Save Link As and save the .xpi file, then install the .xpi you downloaded in the Tools->Add-ons menu in Zotero.
  • Hi - Trying to change the delimiter between multiple authors from _ to , or &, and it does not affect the renaming. The preview persistently shows an underscore between the author names.

    I'm very, very new to this, so I'm likely missing something basic. Any help available is much appreciated.

    Thank you!
  • How exactly are you renaming files? What exact sequence of clicks?
  • Hi,
    I am happy zotfile user and I am using frequently the feature to send the documents to my tablet remote directory.
    Since about two weeks now, the transfer back does not work as before. Now, the transfer back does not include the annotations anymore and I just have the clean pdf as before.

    Does anyone has an idea?

    version => 5.0.52, platform => Win32, oscpu => Windows NT 10.0; WOW64, locale => en-US, appName => Zotero, appVersion => 5.0.52, extensions => Zotero LibreOffice Integration (5.0.14.SA.5.0.52, extension), Zotero Word for Windows Integration (5.0.8.SA.5.0.52, extension), ZotFile (5.0.9, extension)

    Best Regards
  • Can you confirm that the PDF in the tablet folder (if you open from your computer file system) has the annotations? The likely culprit is that the annotated file hasn’t synced back to your computer yet.
This discussion has been closed.