How to add a x tag to all tiddlers of y tag at once?

Problem adding the “Develop NPCs” tag to all tiddlers of the “People” tag at once. there are two tiddlers on this topic.

  1. “tiddlers-filter” without tags and “[tag[People]]” as code.
  2. “New Tiddler” without tags and “<$button>
    Add tag to selected tiddlers
    <$action-listops $filter=”[addsuffix[ ]addsuffix[Develop NPCs]]" $field=“tags” $subfilter="-[Develop NPCs]"/>
    </$button>" as code.

Once clicking the “Add tag to selected tiddlers”, it gives “New Tiddler” a “Filter error: Missing [ in filter expression” tag.

Any suggestions?

Try this:

<$button>
Add tag to selected tiddlers
<$list filter="[tag[People]]"><$action-listops $tags="[[Develop NPCs]]"/></$list>
</$button>

Notes:

  • The <$list filter="[tag[People]]">...</$list> syntax performs the enclosed $action-listops for each tiddler tagged with “People”
  • The $action-listops widget ADDS the [[Develop NPCs]] tag to each tiddler
  • $tags="[[Develop NPCs]] is equivalent to $field="tags" $subfilter="[[Develop NPCs]]

enjoy,
-e

2 Likes

a note: if you want to do this more and don’t want to make one-off buttons every time consider using kookma’s Commander Plugin 2.1.6 — bulk operations on iddlers (kookma.github.io) which is made to make things like this very easy :slight_smile:

2 Likes