ZoteroPane.getItems() is not a function?

62 views
Skip to first unread message

Max N

unread,
Feb 9, 2022, 6:10:42 AM2/9/22
to zotero-dev
Hey together,

I would like to program a simple plugin, but for some reason the Javascript API is not working as expected.

At a first step I just want to get a list of all items in the active pane. I run

```Javascript
var ZoteroPane = Zotero.getActiveZoteroPane();
ZoteroPane;
```
in the developer console. And get the object. Also it writes:
```
...
"getItems": function () {...}
...
```
But if i run
```Javascript
var ZoteroPane = Zotero.getActiveZoteroPane();
ZoteroPane.getItems();
```
the error message is TypeError: ZoteroPane.getItems is not a function.

Do you have any idea what might be wrong? The thing happens for most of the other functions.

Kind regards,
Max

Btw.: I am on 5.0.96.3

Dan Stillman

unread,
Feb 9, 2022, 6:12:02 AM2/9/22
to zoter...@googlegroups.com
On 2/9/22 5:57 AM, 'Max N' via zotero-dev wrote:
> the error message is TypeError: ZoteroPane.getItems is not a function.
>
> Do you have any idea what might be wrong?

It's not a function. What makes you think it is?

ZoteroPane.getSelectedItems() is a function.

Max N

unread,
Feb 9, 2022, 7:47:58 AM2/9/22
to zotero-dev
Hey Dan,

it was listed in the ZoteroPane object. But yes, you are right. It was listed for a Collection. I think it just made sense to me to get the selected items via getSelectedItems() and all items of the pane via getItems(). As this does not seem to be the case; How can I get all the items in the current pane, including search and tag filtering?

Thanks,
Max
Reply all
Reply to author
Forward
0 new messages