Is it possible to automatically execute "Create bibliography for item" if given a key/citekey?
I'm working on an Alfred workflow (on MacOS) and would like to automatically generate the bibliographic entry for an item on demand.
Essentially, given a key for an item (BBT or zotero native key, captured earlier in the workflow), I want to have the bibliographic entry copied to the clipboard so I can paste it into a doc in a later stage of the workflow.
It isn't clear if this is strictly a client-side feature, or if I can perhaps make an API call to execute it.
I also have access to Keyboard Maestro if that is how it needs to be done.
Thanks!
Essentially, given a key for an item (BBT or zotero native key, captured earlier in the workflow), I want to have the bibliographic entry copied to the clipboard so I can paste it into a doc in a later stage of the workflow.
It isn't clear if this is strictly a client-side feature, or if I can perhaps make an API call to execute it.
I also have access to Keyboard Maestro if that is how it needs to be done.
Thanks!
For local use, your main options would be to use BBT's debug-bridge and run some JavaScript or to use Alfred to open a zotero://select link to bring Zotero to the front with the item selected and initiate a Quick Copy.
Using the web API would obviously prevent you from needing Zotero to be open.
What I'm looking for next is a way to generate the actual text reference in APA or whatever format – the item that is pasted into the text or word doc. I'm only using BBT for the cite key feature right now, not using it in a LaTeX doc at all.
The end to end feature I'm going for is, when the script is passed a cite key it creates a new file and pastes in the reference (APA or Chicago or whatever format) – that file is where I'll take notes on the source. I've got it doing everything I want except for getting the reference. I can get the reference manually via quick copy but don't see how to automate it yet.
Is that something the debug bridge could support? If so where is documentation on it?
Also where is the documentation on the x-callback-url scheme? I can't find it, only questions about how to have Zotero recognize callback URLs for other apps. If that is the route I need to go I can do it and run a Keyboard Maestro macro, or perhaps Alfred can do that also, I haven't experimented with sending keystrokes from it.
Thanks.
When I run the quick copy command in Zotero the content is pasted immediately into my plain text document without any conversion needed by me. This is why I assumed it was plain text. It's possible the app is making the conversion during paste though.
> format=bib is how you get bibliographic output from the API
Ah I see it now. Previously when experimenting with the API I was retrieving an HTML table which led me to think I would need to manually build the correct format for pasting into text.
It appears `style` is the parameter I was looking for. I was looking in a separate section of the docs before.
> That's not something Zotero supports.
I meant the url scheme in general, I misspoke. I can't seem to find official documentation on the scheme, only various articles discussing it. Is there an official reference in the docs for the `zotero://` scheme?
In theory a flag to return text could be added to the API, but anything making an API request should be able to pretty easily convert HTML to plain text if that's really desired. The clipboard, by comparison, needs a plain-text variant for normal operation. No, but you can see the zotero://select and zotero://open-pdf comments for the proper forms.