Import PDFs linked in BibDesk file into Zotero
Hello,
Is it possible to import PDFs alongside references from BibDesk file to Zotero? In the BibDesk file the PDFs are linked in the form of Bdsk-File (there is also Bdsk-Url field, however it is not needed). I guess this needs some kind of conversion to a regular file link, however haven't find any solution to this yet.
Thank you in advance.
Miha
Is it possible to import PDFs alongside references from BibDesk file to Zotero? In the BibDesk file the PDFs are linked in the form of Bdsk-File (there is also Bdsk-Url field, however it is not needed). I guess this needs some kind of conversion to a regular file link, however haven't find any solution to this yet.
Thank you in advance.
Miha
Thanks!
*****
%% This BibTeX bibliography file was created using BibDesk.
%% https://bibdesk.sourceforge.io/
%% Saved with string encoding Unicode (UTF-8)
@article{Senior:2020aa,
Abstract = {ABSTRACT},
Author = {Senior, Andrew W and Evans, Richard and Jumper, John and Kirkpatrick, James and Sifre, Laurent and Green, Tim and Qin, Chongli and {\v Z}{\'\i}dek, Augustin and Nelson, Alexander W R and Bridgland, Alex and Penedones, Hugo and Petersen, Stig and Simonyan, Karen and Crossan, Steve and Kohli, Pushmeet and Jones, David T and Silver, David and Kavukcuoglu, Koray and Hassabis, Demis},
Date-Added = {2020-01-30 16:19:59 +0100},
Date-Modified = {2020-01-30 16:19:59 +0100},
Doi = {10.1038/s41586-019-1923-7},
Journal = {Nature},
Journal-Full = {Nature},
Month = {Jan},
Pmid = {31942072},
Pst = {aheadofprint},
Title = {Improved protein structure prediction using potentials from deep learning},
Year = {2020},
Bdsk-Url-1 = {https://doi.org/10.1038/s41586-019-1923-7},
Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxATU2VuaW9yXzIwMjBfYWFhLnBkZk8RAXoAAAAAAXoAAgAABGJpY2kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCRAAB/////xNTZW5pb3JfMjAyMF9hYWEucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAEAAgAACiBjdQAAAAAAAAAAAAAAAAAMQmliRGVza190ZXN0AAIAQS86VXNlcnM6bWloYTpEcm9wYm94Ol9OYWJpcmFsbmlrOkJpYkRlc2tfdGVzdDpTZW5pb3JfMjAyMF9hYWEucGRmAAAOACgAEwBTAGUAbgBpAG8AcgBfADIAMAAyADAAXwBhAGEAYQAuAHAAZABmAA8ACgAEAGIAaQBjAGkAEgA/VXNlcnMvbWloYS9Ecm9wYm94L19OYWJpcmFsbmlrL0JpYkRlc2tfdGVzdC9TZW5pb3JfMjAyMF9hYWEucGRmAAATAAEvAAAVAAIAC///AAAACAANABoAJAA6AAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAbg=}}
@article{Pavsic:2014aa,
Abstract = {ABSTRACT},
Author = {Pav{\v s}i{\v c}, Miha and Gun{\v c}ar, Gregor and Djinovi{\'c}-Carugo, Kristina and Lenar{\v c}i{\v c}, Brigita},
Date-Added = {2020-01-30 16:19:18 +0100},
Date-Modified = {2020-01-30 16:19:18 +0100},
Doi = {10.1038/ncomms5764},
Journal = {Nat Commun},
Journal-Full = {Nature communications},
Mesh = {Antigens, Neoplasm; Cathepsin L; Cell Adhesion Molecules; Cell Membrane; Crystallography, X-Ray; Epithelial Cell Adhesion Molecule; Epitopes; Glycosylation; Humans; Models, Molecular; Mutation; Protein Conformation; Protein Multimerization; Protein Stability; Protein Structure, Tertiary},
Month = {Aug},
Pages = {4764},
Pmid = {25163760},
Pst = {epublish},
Title = {Crystal structure and its bearing towards an understanding of key biological functions of EpCAM},
Volume = {5},
Year = {2014},
Bdsk-Url-1 = {https://doi.org/10.1038/ncomms5764},
Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhbxAVAFAAYQB2AHMDDABpAGMDDABfADIAMAAxADQAXwBhAGEAYQAuAHAAZABmTxEBhgAAAAABhgACAAAEYmljaQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEJEAAH/////EFBhdiNGRkZGRkZGRi5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAQACAAAKIGN1AAAAAAAAAAAAAAAAAAxCaWJEZXNrX3Rlc3QAAgBFLzpVc2VyczptaWhhOkRyb3Bib3g6X05hYmlyYWxuaWs6QmliRGVza190ZXN0OlBhdnPMjGljzIxfMjAxNF9hYWEucGRmAAAOACwAFQBQAGEAdgBzAwwAaQBjAwwAXwAyADAAMQA0AF8AYQBhAGEALgBwAGQAZgAPAAoABABiAGkAYwBpABIAQ1VzZXJzL21paGEvRHJvcGJveC9fTmFiaXJhbG5pay9CaWJEZXNrX3Rlc3QvUGF2c8yMaWPMjF8yMDE0X2FhYS5wZGYAABMAAS8AABUAAgAL//8AAAAIAA0AGgAkAFEAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAB2w==}}
Bibdesk refers to them as MacOS aliases: https://sourceforge.net/p/bibdesk/wiki/FAQ/#what-are-all-these-bdsk-file-and-bdsk-url-fields-that-appear-in-my-bibtex-file
Is there any way we can convert them to something useable?
edit: maybe https://gist.github.com/sprig/851295c454b0b6d1d545a4068a9d3428 , but that uses CoreServices, so MacOS only.
1. Set BibDesk to rename (autofile) the PDFs (and other attached files - careful when importing in Zotero/Zotfile to that also non-PDFs are handled) to something simple without any non-English characters, i.e. YEAR+AAAA+few unique characters.
2. Install the LinkedFilesToFields.applescript from https://github.com/andriusvelykis/bibdesk-scripts into BibDesk (i.e., copy it to the Library/Application Support/BibDesk/Scripts).
Before that I suggest to edit it (instructions are in the comments within the script file) so that the field for file path will contain absolute path (the relative starting with ./ is not recognized by Zotero, at least it did not function for me) and that the path field name is "File". For multiple files linked to the same reference the fields will then be File, File-2, File-3 etc.
3. Run the abovementioned script from within BibDesk, save and close the bib file.
4. Open the bib file in, for example, TextEdit and rename any File-2, File-3 etc. fields to File. Only this way the Zotero will recognize all the attached filenames. Save the edited file.
5. Import the file into Zotero (enable import of linked files). If Zotfile is installed and configured the PDFs under the File field will be imported and renamed according to the set rules. Only the files that were previously linked under File-2, File-3 etc. fields won't be omported into Zotfile folder - but that is why there is AAAA in the filename of them. One can do a search of AAAA within the library, select all the files that have not been renamed yet, and trigger renaming from the Zotfile menu. Voila!
***
%% This BibTeX bibliography file was created using BibDesk.
%% https://bibdesk.sourceforge.io/
%% Saved with string encoding Unicode (UTF-8)
@article{Senior:2020aa,
Abstract = {ABSTRACT.},
Author = {Senior, Andrew W and Evans, Richard and Jumper, John and Kirkpatrick, James and Sifre, Laurent and Green, Tim and Qin, Chongli and {\v Z}{\'\i}dek, Augustin and Nelson, Alexander W R and Bridgland, Alex and Penedones, Hugo and Petersen, Stig and Simonyan, Karen and Crossan, Steve and Kohli, Pushmeet and Jones, David T and Silver, David and Kavukcuoglu, Koray and Hassabis, Demis},
Date-Added = {2020-01-30 16:19:59 +0100},
Date-Modified = {2020-02-03 22:42:27 +0100},
Doi = {10.1038/s41586-019-1923-7},
File = {/Users/miha/Dropbox/_Nabiralnik/BibDesk_test/2020_aaaaaaaa.pdf},
Journal = {Nature},
Journal-Full = {Nature},
Month = {Jan},
Pmid = {31942072},
Pst = {aheadofprint},
Remote-Url = {https://doi.org/10.1038/s41586-019-1923-7},
Title = {Improved protein structure prediction using potentials from deep learning},
Year = {2020}}
@article{Pavsic:2014aa,
Abstract = {ABSTRACT},
Author = {Pav{\v s}i{\v c}, Miha and Gun{\v c}ar, Gregor and Djinovi{\'c}-Carugo, Kristina and Lenar{\v c}i{\v c}, Brigita},
Date-Added = {2020-01-30 16:19:18 +0100},
Date-Modified = {2020-02-03 22:42:27 +0100},
Doi = {10.1038/ncomms5764},
File = {/Users/miha/Dropbox/_Nabiralnik/BibDesk_test/2014_aaaaaaaa.pdf},
File-2 = {/Users/miha/Dropbox/_Nabiralnik/BibDesk_test/2014_aaaaaaab.pdf},
Journal = {Nat Commun},
Journal-Full = {Nature communications},
Mesh = {Antigens, Neoplasm; Cathepsin L; Cell Adhesion Molecules; Cell Membrane; Crystallography, X-Ray; Epithelial Cell Adhesion Molecule; Epitopes; Glycosylation; Humans; Models, Molecular; Mutation; Protein Conformation; Protein Multimerization; Protein Stability; Protein Structure, Tertiary},
Month = {Aug},
Pages = {4764},
Pmid = {25163760},
Pst = {epublish},
Remote-Url = {https://doi.org/10.1038/ncomms5764},
Title = {Crystal structure and its bearing towards an understanding of key biological functions of EpCAM},
Volume = {5},
Year = {2014}}
For Pst - I don't know, but I certainly didn't put it there manually.
Btw, here I was using Zotero 5.0.82, Better BibTeX 5.2.14 and Zotfile 5.0.15.
BibDesk UI shows those as additional fields.
https://pypi.org/project/bibdesk2zotero/
Bdesk-File-n
? I'll add support to BBT.Better BibTeX generates a .bib file from my Zotero library, which can then be opened in BibDesk. This imports most of the reference info and metadata but BibDesk doesn't 'see' the links to the PDF files. The exported .bib has information about the linked files, formatted as an absolute path associated with the `file` field for each reference.
I haven't tried Zot2Bib yet because it isn't updated for Zotero 6. Looks like it could be promising if updated by @gmac or another community member.