windingwind / zotero-actions-tags

Customize your Zotero workflow.
GNU Affero General Public License v3.0
1.94k stars 48 forks source link

[Bug] Zotero_Tabs not support in script #355

Closed saccohuo closed 3 months ago

saccohuo commented 3 months ago

Is there an existing issue for this?

Are you using the latest Zotero and the latest plugin?

Environment

Describe the bug

Zotero_Tabs api not support in script. Is there some limitation on the api? I am writing a script to get all annotations in the current pdf Reader tab. It works on Tools menu, but not works on Reader menu.

Debug Output

The same code in Run Javascript and Actions&Tags script give the different result.

Run Javascript code:

Zotero.debug("test: Zotero.Zotero_Tabs is " + typeof Zotero.Zotero_Tabs);
Zotero.debug("test: Zotero_Tabs is " + typeof Zotero_Tabs);

Run Javascript output:

(3)(+0015537): test: Zotero.Zotero_Tabs is undefined

(3)(+0000000): test: Zotero_Tabs is object

Actions&Tags script code::

Zotero.debug("test: Zotero.Zotero_Tabs is " + typeof Zotero.Zotero_Tabs);
Zotero.debug("test: Zotero_Tabs is " + typeof Zotero_Tabs);

Actions&Tags script output:

(3)(+0000001): test: Zotero.Zotero_Tabs is undefined

(3)(+0000000): test: Zotero_Tabs is undefined

Anything else?

image image

windingwind commented 3 months ago

See https://github.com/windingwind/zotero-actions-tags?tab=readme-ov-file#custom-script -> require