where to find each reference's unique ID?
I know that each reference saved in Zotero has a unique identifier, but I'm trying to find out where that is saved.
Ultimately, I want to be able to export this field in my .ris file.
Thanks!
Ultimately, I want to be able to export this field in my .ris file.
Thanks!
That said, I don't think this is what you are looking for. What exactly do you want to do with this ID in you RIS file?
I see that someone else was trying to do the same thing as me (import into Distiller SR) - there isn't a resolution on it though: https://forums.zotero.org/discussion/comment/347953/#Comment_347953
What I've looked into as options:
1. I can put a unique ID in the "Extra" field, but there doesn't seem to be a way to easily automate this.
-- One option would be to manually enter them (very time-consuming)
-- The other option is to export to csv, add an ID as the "Extra" field (incrementing by 1 each row) and then re-import back to Zotero. (I'd either have to merge all the references or delete the first set after export)
2. Better Bibtex can generate citation keys, but Distiller requires the ID to be numeric only and I don't see that I could get a stable, unique, numeric ID from the available fields.
3. Other workaround using EndNote
I've used Endnote for our Distiller projects in the past, so I could always export to that then to distiller. The issue is that we still need a zotero library for distribution. The import using XML from endnote doesn't automatically put the endnote id into the extra field, but I think I should be able to change that by customizing the translator? I started to try this but I got a bit overwhelmed with it since I'm not very familiar with github repositories and using all of that.
It would be pretty easy to run some JavaScript to add a numeric id to the Extra field of all selected items in Zotero. We could help with that if you want. You could also do it via the Zotero API using something like pyzotero, though that would be slower.
Ideally, I would recommend a format other than RIS, such as Better CSL-JSON or Better BibLaTeX. What formats can DistillerSR import?
Yes, I need it to be numeric, otherwise BBT's citation key generator would be perfect. DistillerSR only allows import by RIS, CSV, or compressed endnote (ENLX).
The JavaScript solution sounds like it would work! I figured there was a way to do that. I will see if I can figure it out on my own in the next few days (it seems like it should be fairly straightforward - and good practice). Then if I need more help I will reach out.
Thanks!
Do you know how long the libraryID and itemKey fields are?
I can trivially expose the itemID, but these are bound to the local database. If you sync, the same item is almost guaranteed to get a different itemID. Item merges will also affect citekeys.
edit: the library ID is numeric but I have several that are 7 digits. The key is 8 positions (IIRC) alphanum, so lets say on average 12 positions with an upper limit of 16. In any case, you immediately cross the 9 threshold.
[item-id]
would give it to you in the citekey.1. need an Zotero-external database to match numbers to URIs, or
2. need more (a lot more) places than 9 digits
assigning numeric keys "with javascript" isn't a solution unless you have a reliable source for unique numbers. The assignment is not the difficult part.