Display Item Key
Is there no way to expose the unique item key (with or without library key) in the GUI (Standalone or add-on)?
I'm working on a website that will use the API calls to display citation information on pages. The pages are currently offline in a spreadsheet with a meta field "zotero_key" that I'm adding as I pull citations. These will be used to autogenerate the citation on the site.
Currently, to find that key, I need to wait for the web sync, then go to the item and copy it's id. Surely this is stored locally and could be coaxed out somehow?
Note - I've read up on what I can find here, with no success. It seems lots of people are wanting to change ID's. I just want to see what the ItemKey is so I can use it later with the API.
I'm working on a website that will use the API calls to display citation information on pages. The pages are currently offline in a spreadsheet with a meta field "zotero_key" that I'm adding as I pull citations. These will be used to autogenerate the citation on the site.
Currently, to find that key, I need to wait for the web sync, then go to the item and copy it's id. Surely this is stored locally and could be coaxed out somehow?
Note - I've read up on what I can find here, with no success. It seems lots of people are wanting to change ID's. I just want to see what the ItemKey is so I can use it later with the API.
I know that's not super convenient, but in terms of currently available options I think that's the best there is.
I'd think it would be possible to write a translator that can export the item key, but I don't think that's been done.
Any clue as to where I could hack it in to, say, display the key in the report generated by standalone? (Is there a translator for the standard Zotero "generate report"?)
Of course, the ultimate would be to include the key as an un-editable field in the Info tab of an item. It is available, why not let us see it?
Thanks for the awesome work.
Do you mind sharing your custom export filter?
I want to be able to reference documents from the zotero database in other applications and documents, that an easy key would be handy.
Thanks
Florian
function doExport() {
var item;
while(item = Zotero.nextItem()) {
Zotero.write(item.key + " - " + item.title + "\n");
}
}
https://gist.github.com/3134386
Very nice.
https://zoteromusings.wordpress.com/2013/04/23/zotero-item-uris-from-client/
https://marutschke.eu/extract-zotero-item-key-from-local-sqlite-database-using-python/
1) For what it's worth, this can be done much more easily in the Run JavaScript window.
2) If you're going to do it directly on the DB from outside, the proper way to do it would be by joining the `items` table with other tables (`itemCreators`, `creators`, `itemData`, `fields`), not using `syncCache`, which is, as the name suggests, a cache for syncing, not the canonical source for the data. That table won't necessarily reflect current data and won't even be populated if people aren't using syncing.
3) If you're going to use `syncCache`, you certainly don't want to be parsing it with a regex. I'm not sure why you even include that option in your post. It's a JSON string — it should be parsed as JSON.
Thank you for your feedback. No objections here.
This was meant as an additional approach. I will implement 2) when time allows.
Explanation and disclaimer for 3) are given in the text.
Thank you again. I see that it could be misunderstood. I spelled it out more clearly and removed the coding sections in question.