In generation citations for my Emacs org-mode integration, I used to
be able to do this, via MozRepl:
var Zotero = Components.classes["@zotero.org/Zotero;1"] .getService(Components.interfaces.nsISupports).wrappedJSObject;
var lkh = Zotero.Items.parseLibraryKeyHash("0_QZXS7E6Q");
var item = Zotero.Items.getByLibraryAndKey(lkh.libraryID, lkh.key);
var biblio = Zotero.QuickCopy.getContentFromItems(new Array(item), "http://www.zotero.org/styles/chicago-note-bibliography");
And then use ``biblio.html`` to retrieve an HTML representation of a
bibliography entry. This no longer seems to work.
According to [1] I can use:
var biblio = Zotero.QuickCopy.getContentFromItems(new Array(item),
Zotero.Prefs.get("export.quickCopy.setting"));
var biblio_html_format = cite.html; /* sic? should be biblio.html? */
But this does not seem to work either. Ultimately I would like to get
away from MozRepl but no other solution seems easy at the moment.
Any suggestions?
best, Erik
1. http://www.zotero.org/support/dev/client_coding/javascript_api
At Sat, 16 Apr 2011 16:44:35 -0700 (PDT),
Frank Bennett wrote:
> From the code, it looks like you need to prepend the style string with
> "bibliography=", so:
>
> var biblio = Zotero.QuickCopy.getContentFromItems(new Array(item),
> "bibliography=http://www.zotero.org/styles/chicago-note-
> bibliography");
>
> (Guessing that the URI id is used to reference styles internally)
>
> Does that work?
Thanks! Turns out that was what I *was* doing in my code, but my
attempts to do this manually were not done right. In the end the issue
was that I needed to increase the time I wait for a file to be
written.
Thanks for the help.
best, Erik