Translator devel web - doWeb - all items instead of chosen ones

I am writing my first zotero translator - congratulations on the great how tos!

I run into one issue that I don't find information on these forums, maybe it is so basic. Which return value or inner function of doWeb is responsible for the selection?

When I run doWeb, I do correctly get a box to select items to save. But even if I select some, still all items get saved to zotero. What is missing?



function doWeb(doc, url) {
if (detectWeb(doc, url) == "multiple") {
Zotero.selectItems( getSearchResults(doc, false), function (items) {
if (!items) {
return true;
}
var articles = [];
for (var i in items) {
articles.push(i);
}
} );
}
}
  • This shouldn't import anything. Typically you'd have a line like ZU.processDocuments(articles, scrape);
    after pushing the items to the articles array.
  • You can look at some common code blocks for translators. Normally, I just copy and paste everything there and then just go through the four lines with TODOs. The scrape function can then mean more work.

    @_Ceridwen_ : I am looking forward to see your translator, if share it with us.
Sign In or Register to comment.