Skip to content

Instantly share code, notes, and snippets.

@charmoniumQ
Created June 27, 2022 05:39
Show Gist options
  • Save charmoniumQ/d0b4c5689956fb3150a6545016d34851 to your computer and use it in GitHub Desktop.
Save charmoniumQ/d0b4c5689956fb3150a6545016d34851 to your computer and use it in GitHub Desktop.
// Sort items by publication venue in Zotero
// Highlight a set of items first.
const items = Zotero.getActiveZoteroPane().getSelectedItems();
itemsByPub = {};
for (const i in items) {
itemInfo = items[i].toJSON();
publication = itemInfo.publicationTitle;
if (!(publication in itemsByPub)) {
itemsByPub[publication] = [];
}
itemsByPub[publication].push(itemInfo.title);
}
itemsByPub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment