Hi, Mat —

Tobias's setvars plugin may be able to come to your rescue here.  With it 
installed you could write something like this:

\define c() <$count filter="[prefix[New]]"/>

<$setvars _count=<<c>> count="count">
<$button>
<$action-setfield result=<<count>> result2=<<count>>/>
x
</$button>
</$setvars>

Setvars uses underscore-prefixed "attributes" to capture dynamic content 
and then sets "variables" using combinations of the specified attributes. 
 (You can also set variables directly if they're text strings, but I use it 
regularly to capture wikified output and set it as a variable to use in 
something that follows.)

Here, _count=<<c>> gets the wikified output of your <<c>> macrocall, and 
count="count" sets the variable count (which you refer to with macrocall 
<<count>> within the scope of the current instance of <$setvars>) to be 
that text string.

You could also use <$setvars> to build out the entire <$action-setfield> 
widget string:

\define c() <$count filter="[prefix[New]]"/>

<$setvars
  _count=<<c>>
  button-action="""\<$action-setfield result="\ count \" result2="\ count \
"/>\"""
>
<$button>
<<button-action>>
x
</$button>
</$setvars>

The backslashes set off literal text in a variable declaration and spaces, 
so the variable button-action here is being built from literal strings and 
variables (well, one variable here: count).

You can get setvars here:
https://tobibeer.github.io/tw5-plugins/#setvars

It's one of those plugins I sometimes think might be worth incorporating 
into the core, if only because I use it for virtually *everything*.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/cce38b12-537f-451e-b777-34953b3a0d26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to