On Wednesday, May 26, 2021 at 6:10:16 PM UTC-7 [email protected] wrote:
> Is there an alternative that does not involve user interaction that can,
> within one macro, commit writes to a tiddler such that the macro can
> subsequently read the tiddler ?
>
There is a "trick" that will, for some use-cases, allow you to achieve the
results you want.
Let's assume you are triggering the actions via a $button widget. There
are two ways to define the $button actions
1) In the body of the $button widget
2) using the actions= parameter of the $button widget.
The trick is to use both methods. Action in the $button body are performed
first. Then, *after those actions are completed*, the action=... parameter
is processed.
Thus,
\define part1()
<$action-setfield foo="something" />
\end
\define part2()
<$list filter="[{!!foo}match[something]]">
<$action-setfield bar="somethingelse" />
</$list>
\end
<$button actions=<<part2>>> click me <<part1>> </$button>
Unfortunately, this technique can't be generalized to more than two
separate sets of actions, but even so, it is still quite useful for solving
a number of sticky problems.
enjoy,
-e
--
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/0915ccf0-ce72-454a-8b83-df41b703b94bn%40googlegroups.com.