mozrepl

Zotero commandline, or, How I Learned to Stop Worrying and Love the MozRepl

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

    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?