I've made some progress with this, here's where I'm currently stuck.
I'm pasting the text (##header and body) in an <$edit-text> widget. This is linked to a different, dedicated Tiddler called NewEntryData. Then I'm bringing back only the month bit from the header by using the following. The button text appears as it should (Set to: "05" for example), so this tells me that the testmonth variable is properly filled.
Unfortunatelly though, the same variable in the
<$action-setfield> part is always set either to the literal value of the filter right above (i.e.
<$list filter... etc ), or is set to the literal text
<<testmonth>>. It depends on what combination of variable reference I use (I've tried everything descibed in Tobias'
Variables vs. Parameters reference list).
Any idea how should I reference the variable in the widget's parameters for it to get the actual content instead of some literal text?
<$vars testmonth='<$list filter="[{NewEntryData!!text}removeprefix[##]trim[]splitregexp[\n]trim[]first[]splitregexp[]rest[4]first[2]join[]]"/>'>
<$button>
<$action-setfield input-month=<<testmonth>> />
Set to: "<<testmonth>>"
</$button>
</$vars>