### Zotero Actions Tags Development Setup Source: https://github.com/windingwind/zotero-actions-tags/blob/master/README.md Provides the bash commands necessary to set up the development environment for Zotero Actions Tags. This includes cloning the repository, installing dependencies, and building the plugin. ```bash git clone https://github.com/windingwind/zotero-actions-tags.git cd zotero-actions-tags npm install npm run build ``` -------------------------------- ### Accessing Item Fields with JavaScript Source: https://github.com/windingwind/zotero-actions-tags/blob/master/README.md Demonstrates how to access and manipulate fields of a Zotero item using JavaScript within the custom script environment. This includes getting the title and managing tags. ```javascript item.getField('title') ``` ```javascript item.getTags().map(tag => tag.tag) ``` ```javascript item.addTag('tag') ``` ```javascript item.removeTag('tag') ``` -------------------------------- ### Importing Global Variables with require() in JavaScript Source: https://github.com/windingwind/zotero-actions-tags/blob/master/README.md Illustrates the use of the `require` function in JavaScript to import global variables and modules within the Zotero Actions Tags custom script environment. Examples include accessing ZoteroPane functions and retrieving item details from the current tab. ```javascript const selectedItems = require('ZoteroPane').getSelectedItems() ``` ```javascript const Zotero = require("Zotero"); const Zotero_Tab = require("Zotero_Tab"); const itemID = Zotero_Tabs._tabs[Zotero_Tabs.selectedIndex].data.itemID; const item = Zotero.Items.get(itemID); ``` -------------------------------- ### Handling Multiple Items in JavaScript Source: https://github.com/windingwind/zotero-actions-tags/blob/master/README.md Provides JavaScript examples for handling scenarios where multiple Zotero items are selected. It shows how to differentiate between single-item triggers and multi-item triggers to avoid duplicate operations and process all selected items. ```javascript if (item) { // Disable the action if it's triggered for a single item to avoid duplicate operations return; } if (items?.length > 0) { // Do something with all selected items } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.