<$action-setfield $tiddler="New Tiddler 2" $field="title" $value="New Name" />\define archiveHere()
$(currentTiddler)$
\end
\define archiveHereButton(completed caption)
<$button tooltip={{$:/user/button/ArchiveTask/Hint}} class=<<tv-config-toolbar-class>> param=<<archiveHere>> >
<$action-listops $tiddler=<<archiveHere>> $tags="+[append[task-archive]]" />
<$action-setfield $tiddler=<<archiveHere>> title="$completed$ $caption$" />
{{$:/core/images/chevron-down}}</$button>
\end
<!-- 2020-04-24 call macro and pass the fields to concatenate as new title of task -->
<$macrocall $name="archiveHereButton" completed={{!!completed}} caption={{!!caption}}/>\define archiveHere()$(currentTiddler)$\end
\define archiveHereButton(completed caption)<$button tooltip={{$:/user/button/ArchiveTask/Hint}} class=<<tv-config-toolbar-class>> param=<<archiveHere>> ><!-- append archive tag -->
<$action-listops $tiddler=<<archiveHere>> $tags="+[append[task-archive]]" /><!-- open the target tiddler that will be created during the rename-->
<$action-navigate $to="$completed$ $caption$" />
<!-- renaming tiddler will create a new one with existing content -->
<$action-setfield $tiddler=<<archiveHere>> title="$completed$ $caption$" />
<!-- delete the original -->
<$action-deletetiddler $tiddler=<<currentTiddler>> />
{{$:/core/images/chevron-down}}</$button>\end
<!-- 2020-04-24 call macro and pass the fields to concatenate as new title of task --><$macrocall $name="archiveHereButton" completed={{!!completed}} caption={{!!caption}}/>\define my-actions()
<$action-sendmessage $message="tm-home"/>
<$action-sendmessage $message="tm-full-screen"/>
\end
<$button actions=<<my-actions>>>
Click me!
</$button>
It saves you a lot of problems in the long run. Trust me.
You shouldn't call action-widgets inside the button body. It should always look like this:
\define my-actions()
\define archiveHere()
$(currentTiddler)$
\end
\define archiveHereButton(completed caption)
<$button tooltip={{$:/user/button/ArchiveTask/Hint}} class=<<tv-config-toolbar-class>> param=<<archiveHere>> >
<!-- append archive tag -->
<$action-listops $tiddler=<<archiveHere>> $tags="+[append[task-archive]]" />
<$action-sendmessage $message="tm-rename-tiddler" from=<<archiveHere>> to="$completed$ $caption$" />
{{$:/core/images/chevron-down}}</$button>
\end
<!-- 2020-04-24 call macro and pass the fields to concatenate as new title of task -->
<$macrocall $name="archiveHereButton" completed={{!!completed}} caption={{!!caption}}/>\define archiveHere()
$(currentTiddler)$
\end
\define archiveHereButton(completed caption)
<$button tooltip={{$:/user/button/ArchiveTask/Hint}} class=<<tv-config-toolbar-class>> param=<<archiveHere>> >
<!-- append archive tag -->
<$action-listops $tiddler=<<archiveHere>> $tags="+[append[task-archive]]" />
<!-- open the target tiddler that will be created during the rename-->
<$action-navigate $to="$completed$ $caption$" />
<!-- renaming tiddler will create a new one with existing content -->
<$action-setfield $tiddler=<<archiveHere>> title="$completed$ $caption$" />
<!-- delete the original -->
<$action-deletetiddler $tiddler=<<currentTiddler>> />
{{$:/core/images/chevron-down}}</$button>
\end
<!-- 2020-04-24 call macro and pass the fields to concatenate as new title of task -->
<$macrocall $name="archiveHereButton" completed={{!!completed}} caption={{!!caption}}/>@PMario,
And I am also curious of learning why actions should not be in the button widget.