<$list filter = "[{Boar!!senses}split[ ]last[1]]" variable = 'x'>
<<x>> <!-- this is so I could verify that the variable 'x' held the correct value -->
<$button set = "Boar!!passiveperception" setTo = <<x>> >Change Boar's Passive Perception</$button>
</$list>Put the list inside the button and place action widgets inside the list. The button title follows the list.
I always use a seperate list with the same filter to display what will be impacted by the button.
Regards
Tont
\define passiveperception() passive Perception $(x)$
<$button>Change All Passive Perception
<$list filter="[has[senses]]">
<$list filter = "[<currentTiddler>get[senses]split[ ]last[1]]" variable = 'x'>
<$action-setfield passiveperception=<<x>>/>
<!-- <<x>> <br/>this is so I could verify that the variable 'x' held the correct value -->
</$list>
</$list>
</$button>
<$button>Change Senses
<$list filter="[has[senses]]">
<$list filter = "[<currentTiddler>get[senses]split[ ]last[1]]" variable = 'x'>
<$action-setfield senses={{{[<currentTiddler>get[senses]removesuffix<passiveperception>] }}}/>
<!-- <<x>> <br/>this is so I could verify that the variable 'x' held the correct value -->
</$list>
</$list>
</$button>
<!-- Edit: Forgot to include the following line in this original post -->\define suffix() $(y)$ $(x)$
__''Step 1'': Select precise language used in "senses" field:__
<$select tiddler = "$:/TempPassivePerceptionTest" ><option>---</option><option>passive perception</option><option>passive Perception</option><option>PP</option><option>pp</option></$select>
<hr>
__''Step 2'': Grab passive Perception from "senses" field and put it in its own field:__
<$set name = 'y' value = {{$:/TempPassivePerceptionTest}}><$button>Create Passive Perception Fields
<$list filter="[regexp:senses<y>]"><$list filter = "[<currentTiddler>get[senses]split[ ]last[1]]" variable = 'x'><$action-setfield pp=<<x>>/>
</$list></$list></$button><$set>
<hr>
__''Step 3'': Get rid of the 'passive Perception' and score from the "senses" field:__
<$set name = 'y' value = {{$:/TempPassivePerceptionTest}}><$button>Change Senses<$list filter = "[regexp:senses<y>]"><$list filter = "[<currentTiddler>get[senses]split[ ]last[1]]" variable = 'x'>
<$action-setfield senses={{{[<currentTiddler>get[senses]removesuffix<suffix>] }}}/>
</$list></$list></$button></$set>
<hr><!-- List of tiddlers and relevant values -->
<span style = "color:darkred;"> ''List of affected tiddlers | Last Item in the "senses" field | Contents of "pp" field'' </span>
<$set name = 'y' value = {{$:/TempPassivePerceptionTest}}><$list filter = "[regexp:senses<y>]"><$list filter = "[<currentTiddler>get[senses]split[ ]last[1]]" variable = 'x'><br><$link to = {{!!title}}> {{!!title}} </$link> | <<x>> | {{!!pp}}</$list></$list></$set>
Thanks for your help! I see that nested lists are very useful. And I didn't know about transcluding in filter notation like that. I see what you're saying about the second part being sensitive to typos. I realized that in making these tiddlers that I am trying to change, I have used many short-hands for referring to 'passive Perception'. I have used 'passive perception', 'passive Perception', 'PP', and 'pp'. Very sloppy of me, I will admit, though i have never been formally trained in coding so I am learning the housekeeping as I go. Because of this, I decided to try your assigned exercise! I don't think I was able to include a fail-safe, but rather made it more fool proof. Check out what I have: