Ad hoc Javascript: most item fields returned as 'undefined'
Hi,
I'm trying to run some ad hoc Javascript and I'm encountering the following problem:
If I use the following example (slightly modified to return the first entry) from the Help page:
var items = Zotero.getActiveZoteroPane().getSelectedItems();
items[0];
Then when I run the code, I see the JSON for the currently selected entry in the right hand pane of the "Run Javascript" window.
If I change the final line to:
items[0].key
Then I see the key returned in the right hand pane, instead of the JSON for the whole entry.
However, if I try:
items[0].title
Then I see
===>undefined<=== (undefined)
I can retrieve 'key', 'itemType' and 'version', but all other attributes are reported as undefined; returning the whole object confirms that these attributes are defined, they are not empty.
This happens whether or not I use asynchronous mode or synchronous mode. And it happens in both My Library and when using Groups.
I'm using Zotero 6.0.26 on Windows 10.
Does anyone know why this might happen?
I'm trying to run some ad hoc Javascript and I'm encountering the following problem:
If I use the following example (slightly modified to return the first entry) from the Help page:
var items = Zotero.getActiveZoteroPane().getSelectedItems();
items[0];
Then when I run the code, I see the JSON for the currently selected entry in the right hand pane of the "Run Javascript" window.
If I change the final line to:
items[0].key
Then I see the key returned in the right hand pane, instead of the JSON for the whole entry.
However, if I try:
items[0].title
Then I see
===>undefined<=== (undefined)
I can retrieve 'key', 'itemType' and 'version', but all other attributes are reported as undefined; returning the whole object confirms that these attributes are defined, they are not empty.
This happens whether or not I use asynchronous mode or synchronous mode. And it happens in both My Library and when using Groups.
I'm using Zotero 6.0.26 on Windows 10.
Does anyone know why this might happen?
https://www.zotero.org/support/dev/client_coding/javascript_api#get_information_about_an_item