Published on One Big Library. (http://onebiglibrary.net)
Zotero commandline, or, How I Learned to Stop Worrying and Love the MozRepl
By dchud
Created 2008-06-01 12:58

  1. Got Zotero [1]? Good.
  2. Install MozLab [2].
  3. Restart Firefox.
  4. Start MozRepl [3].
  5. Open a terminal.
  6. telnet localhost 4242
  7. Get the Zotero object [4]:

    var zotero = Components.classes["@zotero.org/Zotero;1"] .getService(Components.interfaces.nsISupports)
    .wrappedJSObject;

    ...but all on one line, no spaces before the dots. Sorry, my formatting plugin went b0nkr5.

  8. Surprise your friends, amuse your enemies, bore the big-Zotero-collectionists:

    repl> for each (item in zotero.Items.getAll()) {
    ....> alert(item.getField("title"));
    ....> }

Pretty nifty, eh?

Trackback URL for this post:

http://onebiglibrary.net/trackback/256

Source URL (retrieved on 2008-11-21 00:08): http://onebiglibrary.net/story/zotero-commandline-love-mozrepl

Links:
[1] http://zotero.org/
[2] http://hyperstruct.net/projects/mozlab
[3] http://hyperstruct.net/projects/mozrepl/starting-the-repl
[4] http://dev.zotero.org/interacting_with_zotero_from_within_firefox