Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting citation key to a CSV file #448

Closed
eds89 opened this issue Feb 7, 2016 · 1 comment
Closed

Exporting citation key to a CSV file #448

eds89 opened this issue Feb 7, 2016 · 1 comment
Labels

Comments

@eds89
Copy link

eds89 commented Feb 7, 2016

Hello,
Thanks for making BBT a great plugin, improving the productivity of millions of researchers every day!

So, I wanted to know if it'd be possible to export the citation key to a CSV file as a custom translator. I am aware of how Zotero's translator architecture works, however I am unable to access the citation key field since it is not an actual field of zotero, rather generated by bbt.

@retorquere
Copy link
Owner

I don't know about millions, but thanks :) It is possible as long as BBT is installed. You can grab the key by doing something like

var citekey = Zotero.BetterBibTeX.keymanager.get(item).citekey;

in your translator. This is an internal method of BBT, so I can't guarantee it's not ever going to change, but it hasn't changed in a long while. The keymanager will return an object with a few properties, but most are likely not interesting to you, except of course the citekey field.

There is one other aspect of calling the keymanager. I'm not sure you'd want to make use of it as it has (intended) side effects you might not intend. You can call the keymanager with

var citekey = Zotero.BetterBibTeX.keymanager.get(item, 'on-export').citekey;

If called on a reference that doesn't have a pinned citekey, and the user has set auto-pinning to on export (see link above), calling the key manager with 'on-export' will pin the key at that moment.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants