multiple selection

48 views
Skip to first unread message

weng...@yahoo.com

unread,
Sep 10, 2025, 3:06:56 PM (12 days ago) Sep 10
to zotero-dev
Hi all. 
I was working on a longer post, but it crashed and disappeared.
So here is the shorter version:

I have multiple type
I loaded an items{} object with URLs and Titles from search results.

I triggered the checklist with this line:
let userSelected = Zotero.selectItems(items);

The checklist pops up ok, but it is immediately proceeding to the next line of code (~if !userSelected return) before the user has time to select anything or even cancel.

I changed the function to async and changed the line to:
let userSelected = await Zotero.selectItems(items);

Same thing. I do see examples where Zotero.selectItems() has a second parameter that is a callback function basically doing what my next line of code was doing, but I got my code from looking at another example on the internet where the second param was left out.

Is that the problem?  What else can be causing the code to proceed on while the selection box is still open? 

(The longer version was lots of backstory).

Thanks!


Abe Jellinek

unread,
Sep 10, 2025, 3:08:59 PM (12 days ago) Sep 10
to zoter...@googlegroups.com
As I said before, if you’re doing this on Zotero 5, we can’t provide any support at all.

--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/zotero-dev/6435345b-67a2-4f15-b619-d7e7498c953cn%40googlegroups.com.

weng...@yahoo.com

unread,
Sep 10, 2025, 3:40:43 PM (12 days ago) Sep 10
to zotero-dev
I don't understand what you mean by can't provide support.  This is  a forum for posting questions regarding Zotero translators.
What difference does it make if I'm using version 5?  I'm on a closed system and nothing I write will ever be in the repository.
Are you saying you have some legal reason not to help me figure out why a translator isn't working right because I'm using version 5?

From what I can see, the support community for Zotero is pretty small, and this site is only getting a few posts a month.
Why would you write something so discouraging and unhelpful based on my version of Zotero that almost certainly makes no difference to the code question.

Abe Jellinek

unread,
Sep 10, 2025, 3:52:09 PM (12 days ago) Sep 10
to zoter...@googlegroups.com
(a) Basically no one here would be able to remember which translator APIs / JavaScript features were available on Zotero 5. I am the ~main Zotero translator maintainer (and answerer of questions about them on this list) and I haven’t been working on translators for that long. Nobody can help you with this.

(b) Connecting a five+-year-old version of Firefox to the internet is an awful idea, even if this is only for your own workflow.

Why not just update?

Abe Jellinek

unread,
Sep 10, 2025, 4:06:04 PM (12 days ago) Sep 10
to zoter...@googlegroups.com
Sorry, missed what you said about this system not being connected to the internet. Scratch (b). Still, we really can’t help. Translator APIs, available JavaScript features, and the capabilities of generic translators have all changed significantly since Zotero 5, and it’s unlikely that anybody will want to install Z5 to test things out.

The best thing to do would be to update.

weng...@yahoo.com

unread,
Sep 10, 2025, 4:08:08 PM (12 days ago) Sep 10
to zotero-dev
We're not on the internet. I made that clear in my original post.
It's a closed system within our offices and our personnel use Zotero to scrape metadata from articles posted on various internal websites (not Internet sites).
LIke you, I've been charged with maintaining/repairing translators, and I never heard of Zotero before this landed on my desk. 
I don't make decisions for my office about what browsers we use or software versions or how our PKI certs work or anything. 
I'm just the guy working on some Javascript, translators with next to no feedback at all and apparently no support system on the internet. 
For what it's worth, I have the 600 translators that came with Zotero 5 when it was first installed, and other than the deprecated xPath (which I am updating to querySelectors that also work on version 5), I don't see a dime's worth of difference in the code. 

I don't see what problem you would have with giving me a Zotero 7 answer to a question.  It will either be applicable or it won't.
As for the original problem I posted, I already sorted it out.

Sebastian Karcher

unread,
Sep 10, 2025, 4:17:59 PM (12 days ago) Sep 10
to zoter...@googlegroups.com
Z 7 code uses async functions and will not work (at all) but you can find lots of examples of legacy code in the repository -- Z.selectItems needs to get called w a callback function, see e.g. https://github.com/zotero/translators/blob/master/ABC%20News%20Australia.js

Hth,
Sebastian 

Sent from my phone

weng...@yahoo.com

unread,
Sep 10, 2025, 5:32:18 PM (12 days ago) Sep 10
to zotero-dev
Thanks for the post. I was able to get that code (user selection, close, proceed)  working by switching the next line after selectItems() from negative (if !....  return)  to positive (if (userSelected){}).
Right now, I'm working on the scrape loop.
I have the object containing the URLs from the articles the user selected. 
So far, I don't understand how Zotero can scrape other pages that are not the current DOM.
AI results say that Zotero only scrapes metadata from the active current webpage. 
But if that's so, why bother collecting those URLs?
Consider this post closed.
I'll try to make more progress on my own before posting again.
Thanks, both.

Sebastian Karcher

unread,
Sep 10, 2025, 9:07:10 PM (12 days ago) Sep 10
to zoter...@googlegroups.com
>  I don't understand how Zotero can scrape other pages that are not the current DOM.

ZU.processDocuments loads the DOM of the target URLs (serially, I think)

(AI tends to be terrible with Zotero specific questions, FWIW )
Sebastian 

Sent from my phone

Reply all
Reply to author
Forward
0 new messages