I posted this originally to the zotero forums, but Dan Stillman suggest I post here instead:
Hi,
I have a perl script that used to work to export (from the command line) either the whole library or a single collection as a bibtex file. While the whole library still works, selecting a single collection does not.
In particular, I run something like this to get just the 3rd collection:
var collections = Zotero.getCollections();
var collection = collections[2];
translatorObj.setCollection(collection,1);
but when I run the translator, it still returns the whole library. This is the whole code (I am testing it using MozRepl):
file.initWithPath('/tmp/tmpfile.txt');
var translatorObj = new Zotero.Translate.Export;
var collections = Zotero.getCollections();
var collection = collections[2];
translatorObj.setCollection(collection,1);
translatorObj.setLocation(file);
translatorObj.setTranslator('9cb70025-a888-4a29-a210-93ec52da40d4');
translatorObj.setLibraryID(null);
translatorObj.translate();
Thanks,
Jason