Cannot import pdf files from EndNote

I am new to Zotero. I try to import an Endnote X6 Library into Zotero (4.0.29.15). If I place the XYZ.txt file that I create by exporting EndNote XYZ library into XYZ.Data file I get "java script error" when I try to import by Zotero. If I place XYZ.txt file outside XYZ.Data folder, Zotero imports the whole library but not associated pdf files.

Can anyone help? I have Mac OSX 10.11.6
  • could we get an error report ID from right after the javascript error please? https://www.zotero.org/support/reporting_problems
    This really should work -- my guess would be that the files Zotero is trying to attach may not be there?
  • Thanks.
    I get the following: "[JavaScript Error: "'PDF' must be a file in Zotero.Attachments.importFromFile()"]"
  • Report ID: 842863784
  • D-D
    edited December 26, 2016
    I have checked, and as far as I understand, the files are where they should be. Could files' names be a problem? All files names start with #
  • I'll check on that. Could you open the .txt file with a text editor like notepad and copy the entry for _one_ item that contains a file link here?
    (you can remove your computer name from the filepath, but otherwise I'd need it to be as is).

    An RIS entry starts with TY - and ends with ER -
  • Here is the first entry:

    TY - CHAP
    A2 - N., Setter
    AU - Damjanovic, D.
    AU - Robert, G.
    CY - Lausanne
    L1 - internal-pdf://#1Damjanovic-1527590144/#1Damjanovic.pdf
    N1 - 6
    PB - N. Setter, EPFL
    PY - 2002
    SP - 353
    ST - Piezoelectric hysteresis and nonlinearity in ferroelectric materials
    T2 - Piezoelectric materials in Devices
    TI - Piezoelectric hysteresis and nonlinearity in ferroelectric materials
    UR - file://localhost/Users/dragandamjanovic/DraganData/DraganArchives/My%20archives/my%20papers%20ready%20to%20print/%231Damjanovic.pdf
    ID - 1
    ER -


    UR above points to an old folder where I kept papers before EndNote existed. I do not understand why EndNote still points there when the paper is placed in:
    /Users/dragandamjanovic/DraganData/EndNote Libraries/MyPapers9-Saved-Saved.Data/PDF/#1Damjanovic-1527590144
  • Could anyone, please, follow up on this?
  • sorry about that -- and in what folder exatly are you savig the RIS file?
  • If I put txt file (RIS) into /Users/dragandamjanovic/DraganData/EndNote Libraries/MyPapers9-Saved-Saved.Data , I get "java script error" when I try to import by Zotero.
    If I put txt file into /Users/dragandamjanovic/DraganData/EndNote Libraries, Zotero imports the whole library but not associated pdf files.
  • I am also having a problem importing attached PDFS from EndNote and not seeing any workable solutions in the forums. At some point EndNote starting storing each PDF in an individual folder within it's PDF folder and Zotero can't seem to cope. Any suggestions?
  • I'm still testing this, but I'm not aware of anything that changed that should keep this from working. Certainly the individual folders aren't an issue and we've had this working for many people since Endnote introduced that.

    @D-D could you
    1) make sure the file
    /Users/dragandamjanovic/DraganData/EndNote Libraries/MyPapers9-Saved-Saved.Data/PDF/#1Damjanovic-1527590144/#1Damjanovic.pdf
    exists on your harddisk

    2) Create a new RIS file using TextEdit with just the entry above

    3) Place it into /Users/dragandamjanovic/DraganData/EndNote Libraries/MyPapers9-Saved-Saved.Data

    4) Import it into Zotero

    Does that work or do you still get the error?
  • 1. I confirm that this file exists at place indicated above
    2. TextEdit cannot create .txt files. I use entry above and create txt file with Word.
    3. I put this txt file into /Users/dragandamjanovic/DraganData/EndNote Libraries/MyPapers9-Saved-Saved.Data
    4. As before, I get message:
    "[JavaScript Application ] An error occurred while trying to import the selected file. Please ensure that the file is valid and try again"
  • (for the reference: https://www.tekrevue.com/tip/textedit-plain-text-mode/ Word's autoformatting can mess up code, though I'd imagine it's fine here. I'll take a look, but don't have a Mac for testing, so if this is a Mac-specific issue it may take longer)
  • edited February 11, 2017
    OK, I've been able to reproduce this and track it down and have a provisional fix. The issue is indeed the # in the filepath.

    @D-D -- we might need to think through some issues before implementing the fix, but you can pretty easily do this yourself:

    1. Find the Zotero data directory https://www.zotero.org/support/zotero_data
    2. Open the folder translators
    3. Open the file RIS.js with a text editor (TextEdit should work, but make sure you use plain text mode)
    4. Find this bit https://github.com/zotero/translators/blob/master/RIS.js#L1385
    5. replace the line path: url, with path: encodeURIComponent(url),
    6. save the file and try importing the RIS again. It should work now.

    @dstillman -- I'm a bit clueless about file handling in mozilla, so would appreciate some advice. Currently, filepaths are treated as URIs and thus # is treated as the end of the URI rather than a regular character. We can handle this in the translators (as per my patch suggested above), but it seems like doing this upstream -- in translate_item.js might be better?

    @rbowles -- as you can probably tell, this was a very specific issue. In most cases import of files from Endnote works as described here: https://www.zotero.org/support/kb/importing_records_from_endnote#exporting_your_library_from_endnote if you have problems importing files, please start a new thread and provide details.
  • Thanks, I'll try to do what you suggested and will let you know,
  • Good day,
    the procedure suggested above worked (changing the text on line 1385 in RIS.js file). Thank you. I can now import the library and associated pdf files.
  • Excellent, thanks. We will push this or an analogous fix out to all users asap.
  • This is a follow up. This fix (see adamsmith February 13, 2017 and adamsmith February 11, 2017 above) has not been implemented. I understand that the problem of importing pdf files with unusual names is not a priority but the fix would be useful for several people I know.

    It would also be nice to know if a similar fix can be used for libraries exported as XML files.
Sign In or Register to comment.