*Bulk actions with buttons (previously shared)*


Very easy and exposes a valuable piece of tiddlywiki knowledge worth 
learning.


As you may know, on tiddlywiki.com the following produces a list of 
tiddlers;
<$list filter="[tag[Field Operators]]"> 

</$list>


you can use any filter to generate this list


Now we can look for an action that will open tiddlers eg; 
https://tiddlywiki.com/#ActionNavigateWidget We wrap it in a button so we 
can trigger this action We wrap the action in the list so we can execute 
that action for every tiddler generated by the list Since there is no 
variable= on the list widget the currentTiddler variable changes for each 
item in the list so the default of currentTiddler is used. Since we did not 
provide the $to= parameter in the action-navigate it defaulted to 
currentTiddler

<$button>
   <$list filter="[tag[Field Operators]]">
      <$action-navigate $to="ActionWidgets"/>
   </$list>
Click me!
</$button>


<$list filter="[tag[Field Operators]]">

</$list>



*Why should you learn this deeply?, *it opens up any list to activate any 
action on every tiddler in the list.
   
   - delete a tag
   - remove a tag
   - delete a set of tiddlers
   - more more more

WarningAlways consider showing the list of tiddlers to be impacted by the 
button with a seperate list as I have done above
Regards

On Friday, March 6, 2020 at 9:56:29 PM UTC+11, vpl wrote:
>
> Hi,
>
> Thanks a lot for your quick reponse
>
> I've tested and the button does not appear within the macro
> So I externalized and left the macro alone as below, but this does not work
> How may I trouble shoot or log what's happening during the execution of 
> the macro  ? I'm blocked ..
>
> Thanks for your help
>
>
> \define remove_tag(filter_tag remove_tag)
> <!-- We filter tiddlers with tag "filter_tag"-->
> <$list filter="[tag<__filter_tag__>]" variable="deleteTiddler">
>
> <!-- With each tiddler of this list (stored in "deleteTiddlers" variable) 
> -->
> <$fieldmangler tiddler=<<deleteTiddler>> >
> <!-- We remove the tag "remove_tag" from each tiddler of the list -->
> <$action-sendmessage $message="tm-remove-tag" $param=<<__remove_tag__>>/>
> </$fieldmangler>
>
> </$list>
> \end
>
> <$button actions=<<remove_tag tag-a tag-x>>>remove tag </$button>
>
>
>
> Le vendredi 6 mars 2020 11:16:25 UTC+1, Luis Gonzalez a écrit :
>>
>> The macro:
>>
>> \define remove_tag(filter_tag remove_tag)
>>>
>>> <$button>
>>>
>>> <!-- We filter tiddlers with tag "filter_tag"-->
>>> <$list filter="[tag<__filter_tag__>]" variable="deleteTiddler">
>>>
>>> <!-- With each tiddler of this list (stored in "deleteTiddlers" 
>>> variable) -->
>>> <$fieldmangler tiddler=<<deleteTiddler>> >
>>>
>>> <!-- We remove the tag "remove_tag" from each tiddler of the list -->
>>> <$action-sendmessage $message="tm-remove-tag" $param=<<__remove_tag__>>/>
>>> </$fieldmangler>
>>> </$list>
>>> remove ''<<__remove_tag__>>'' from ''<<__filter_tag__>>'' tagged tiddlers
>>> </$button> 
>>
>>
>>> \end
>>>
>>
>> You call this macro this way:
>>
>> <<remove_tag tag-a tag-x>>
>>>
>>
>> With this code you remove tag-x from all tiddlers tagged with tag-a.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3df8dad4-9956-4bfc-bc72-5dd7b4ac9d96%40googlegroups.com.

Reply via email to