Is there a way to prompt user for choices when not "multiple" items?

I'm new to devving in Zotero, sorry if this is something obvious I'm missing. I'm working on a translator for articles from the Anarchist Library, which offers a variety of formats for download. With some of my work, it helps to have the PDF, web snapshot, and the LaTeX downloaded, so I'm playing with a translator that scrapes a few attachments.

What I would like to do, especially to make it more useful for other people who might want a different set of attachments, is show a pop up much like the `Zotero.selectItems()` to select the desired attachment types. (Ideally, I'd love to also be able to store the choice, and the ability to "don't show this again").

If this somehow falls outside of the scope of what translators are allowed to do, lmk, might be over-extending the tool. Not against learning the core code a little better if a new feature there is welcome, but totally okay hearing I'm out over my skis as a newb <3
  • That's not something we use the Select Items dialog for, no — that's for selecting different items on the page. Among other things, it interferes with the default single-click save action, so it should only be used on, say, search-result pages where there are actually multiple items to choose from.

    Choosing attachment types for a specific save should be done at the Connector level, not the translator level, and that's planned. Now that Zotero supports annotation of EPUBs and web snapshots as well, it will also be possible to specify a preferred prioritization of attachment type in the future.
  • okay, thanks! sorry if beginner question, gotta read through more architecture docs, but does that mean that my translator should just present all available attachment types and let the connector filter it down from there?

    Thanks for the quick response!
  • Yes, but note that it currently *won't* filter them down. For the case you described, saving all of them seems fine. Users can delete the ones they don't want.

    But if, for example, a book archive provided a very large EPUB and a very large PDF for the same item, currently, the translator should choose to save one or the other. Once Connector-side filtering is implemented, it should be changed to save all of them.
Sign In or Register to comment.