How to can I change/set all tiddlers with a tag?

Let’s say I am trying to create a list, using the nsort operator and sort by nsort-field-name, and I have nsort-field-name numbered from 1 to 10. But I want to create a new tiddler and have that nsort-field-name set to 6.

I want to be able to get the tiddler that already has nsort-field-name set at 6 and change that to 7, and set the next one to 8, and so on and so on. Until I have the tiddlers re-numbered from 1 to 11.

First do not create your new tiddler until after you update the other tiddlers.

Next find a way to $list the tiddlers you want to edit, getting the number and adding one to it’s field value and display that.

<$list filter="">
   <$link/> {{!!fieldname}} {{{ [all[current]get[fieldname]add[1]] }}}<br>
</$list>

When you are happy you are selecting the required tiddlers and computing the correct new value; you put this list inside a button as a trigger and within the list replace the display with an action set field widget to set the existing field to the computed value.

Backup you wiki before using the button in case.

<$button>
<$list filter="">
  <$action-setfield fieldname={{{ [all[current]get[fieldname]add[1]] }}}/>
</$list>
Batch update button
</$button>

Thanks, this did the trick!

I already figured out how to use the allafter operator to list all the tiddlers needed for an update.

<$button>
<$list filter="[tag[tagname]nsort[fieldname]allafter{!!title}]">
  <$action-setfield fieldname={{{ [all[current]get[fieldname]add[1]] }}}/>
</$list>
Batch update button
</$button>

Thanks again!

1 Like

You may like Tiddler Commander!