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
Can anyone help? I have Mac OSX 10.11.6
This really should work -- my guess would be that the files Zotero is trying to attach may not be there?
I get the following: "[JavaScript Error: "'PDF' must be a file in Zotero.Attachments.importFromFile()"]"
(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 -
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
If I put txt file into /Users/dragandamjanovic/DraganData/EndNote Libraries, Zotero imports the whole library but not associated pdf files.
@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?
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"
@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,
withpath: 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.
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.
It would also be nice to know if a similar fix can be used for libraries exported as XML files.