See: https://www.perplexity.ai/search/in-previous-conversations-abou-SJtDoN8WQVyCi0_HHSh4Bw#1
You “wire” Actions & Tags to your status tags by creating one action per status (or one toggle action) and assigning each a shortcut and/or menu label that operates on the selected items. Below is a concrete pattern you can drop into Zotero and adapt to your status: tags. github+1
One‑click “set status” actions (no scripting)
If you’re happy to replace the status manually (rather than via custom script), you can get very far with built‑in tag operations:
-
Open Edit → Preferences → Actions & Tags.[github]
-
Click + to add an action.
-
Configure for “set to in‑progress” (example):
-
Repeat for each status (
status: unreviewed,status: analyzed, etc.).
This simply adds the status tag; if you want to ensure only one status is present at a time, use a script instead (next section).History+1
Scripted “make this the only status” action
To enforce “only one status: X at a time”, create one action per status using customScript that removes all other status: tags first.
-
In Actions & Tags preferences, add a new action.[github]
-
Set:
-
Event: None.
-
Operation: customScript.[github]
-
Menu label:
Set status: in-progress. -
Shortcut: e.g.
Ctrl+Alt+2.
-
-
Click the little ⤤ icon to open the multiline editor for Data, and paste this script (adjust the
targetStatusto match the action):
js// Set a single status:* tag on all selected items const targetStatus = "status: in-progress"; if (item) { // Avoid running per-item; we'll handle the batch via `items` return; } if (!items || !items.length) { return; } for (let it of items) { // Remove all existing status:* tags let tags = it.getTags().map(t => t.tag); for (let tag of tags) { if (tag.startsWith("status: ")) { it.removeTag(tag); } } // Add the desired status it.addTag(targetStatus); await it.saveTx(); }
-
Duplicate this action for each status value you use, changing only:
jsconst targetStatus = "status: unreviewed"; // or "status: analyzed", "status: proof-ready", etc.
This pattern uses the items array provided by Actions & Tags so it works on multi‑selection and avoids double‑running on a single item, as recommended in the plugin docs.reddit+1
Scripted “cycle through statuses” toggle (optional)
If you’d like a single shortcut that cycles status for each selected item (e.g., unreviewed → in‑progress → analyzed → proof‑ready → back to unreviewed), use:
-
New action:
-
Event: None.
-
Operation: customScript.
-
Menu label:
Cycle status. -
Shortcut: e.g.
Ctrl+Alt+S.
-
-
Script:
jsconst statusOrder = [ "status: unreviewed", "status: in-progress", "status: analyzed", "status: proof-ready" ]; if (item) { return; } if (!items || !items.length) { return; } for (let it of items) { let tags = it.getTags().map(t => t.tag); // Find current status let currentIndex = -1; for (let i = 0; i < statusOrder.length; i++) { if (tags.includes(statusOrder[i])) { currentIndex = i; break; } } // Remove all status:* tags for (let tag of tags) { if (tag.startsWith("status: ")) { it.removeTag(tag); } } // Compute next status const nextIndex = (currentIndex + 1 + statusOrder.length) % statusOrder.length; const nextStatus = statusOrder[nextIndex]; it.addTag(nextStatus); await it.saveTx(); }
Pressing the shortcut repeatedly will walk the selected items through your status workflow.github+1
Using it in your genealogy log
Once wired:
-
You select a batch of census items for William H. Clark, hit
Ctrl+Alt+2, and every item getsstatus: in-progress(and no other status).History+1 -
When finished analyzing, select them again, hit the shortcut for
status: analyzed, and your saved search “Proof‑Ready Candidates” updates automatically.History+1
If you tell me your exact status tag list and preferred shortcuts, I can hand back ready‑to‑paste scripts for each action with those names baked in.
No comments:
Post a Comment