Batch adding PDF links
I have a Zotero database with about 3000 entries that was imported from a bibtex listing. I also have about 2000 PDFs that I would like to associate with the Zotero items.
I have been drag/dropping files onto the relevant Zotero item and using Zotfile to move the PDF file to the relative directory and create a linked attachment in the item. This works fine but is VERY slow.
I would like to know if there is a simple way to achieve this work flow programmatically; or to simply set many item linked attachment locations programmatically?
I breifly looked at the JavaScript API but couldn't find a good example of how this might be done.
Is this possible to do?
Zotero 4.0.21.5
FireFox 31
Windows 7
I have been drag/dropping files onto the relevant Zotero item and using Zotfile to move the PDF file to the relative directory and create a linked attachment in the item. This works fine but is VERY slow.
I would like to know if there is a simple way to achieve this work flow programmatically; or to simply set many item linked attachment locations programmatically?
I breifly looked at the JavaScript API but couldn't find a good example of how this might be done.
Is this possible to do?
Zotero 4.0.21.5
FireFox 31
Windows 7
dragging the PDF to the respective Zotero item would be pretty difficult to automate - you'd have to write code that lets Zotero find the right attachment for existing items. Not impossible, but certainly nothing quick.
But renaming and moving the items, ZotFile can do in batch (and I though it'd just do it automatically). But if it doesn't do it automatically, just select all items in question and right click-->Manage attachments --> Rename Attachments
That will also move them according to the rules specified in ZotFile.
I was wondering if, in JavaScript, you could do something using the linkFromFile(file,ID) function, such as:
var Zotero = Components.classes["@zotero.org/Zotero;1"].getService(Components.interfaces.nsISupports).wrappedJSObject;
var itemID = Zotero.Attachments.linkFromFile('C:\Zlib\MyPaper01.pdf', 2711)
var itemID = Zotero.Attachments.linkFromFile('C:\Zlib\MyPaper02.pdf', 103)
var itemID = Zotero.Attachments.linkFromFile('C:\Zlib\MyPaper03.pdf', 1902)
:
:
Where the item ID would be extracted from the Zotero database, and the file path and name would be specified as the link?
https://groups.google.com/forum/?fromgroups=#!forum/zotero-dev
It's a little odd that you would still be dragging massive amounts of PDFs into Zotero after using it for this long?