Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:client_coding:javascript_api [2019/01/22 04:37] – dstillman | dev:client_coding:javascript_api [2019/08/18 05:41] – [Running Ad Hoc JavaScript in Zotero] Add examples zuphilip | ||
---|---|---|---|
Line 8: | Line 8: | ||
===== Running Ad Hoc JavaScript in Zotero ===== | ===== Running Ad Hoc JavaScript in Zotero ===== | ||
- | Zotero | + | Zotero |
- | | + | - In the Tools → Developer |
- | | + | |
- In the window that opens, enter JavaScript in the Code textbox and click Run or press Cmd-R/ | - In the window that opens, enter JavaScript in the Code textbox and click Run or press Cmd-R/ | ||
- | To run asynchronous code, check the "Run as async function" | + | When running **asynchronous** code containing '' |
- | In synchronous mode, the value of the final line will appear in the right-hand pane. | + | <code javascript> |
+ | var items = Zotero.getActiveZoteroPane().getSelectedItems(); | ||
+ | return items; | ||
+ | </ | ||
- | (Before Zotero 5.0.61 is released, you'll need to install | + | In **synchronous** mode, the value of the final line will appear in the right-hand pane. The same result as above could be achieved in synchonous mode with |
+ | <code javascript> | ||
+ | var items = Zotero.getActiveZoteroPane().getSelectedItems(); | ||
+ | items; | ||
+ | </ | ||
===== Zotero Code Architecture ===== | ===== Zotero Code Architecture ===== | ||