On Thursday, May 6, 2021 at 5:24:11 AM UTC-7 [email protected] wrote:
> In my project I need to first create a new project with an identifier (an
> input data) then to offer a complete input of the project to the user.
> I have crafted this macro invoked when the identifier is ready to be used.
>
Assuming that your macro is triggered by a button press, you can split the
actions into two separate parts. The first part is specified in the body
of the $button widget, and the second part is specified using the
actions=... parameter of the $button widget. When the button is pressed,
the "body" actions are performed (and *completed*) first, followed by the
"parameter" actions. For example:
\define target() TargetTiddler
\define button_actions() <$action-setfield $tiddler=<<target>>
timestamp2=<<now "0hh0mm0ss0XXX">> />
<$button actions=<<button_actions>>> click me
<$action-setfield $tiddler=<<target>> timestamp1=<<now "0hh0mm0ss0XXX">>
/>
</$button>
When the $button is clicked, the "timestamp1" field is written first and
then the actions=... is triggered, writing the "timestamp2" field.
Also, as a side note, the $set widgets in your code could be written more
simply using $vars and "transcluded filter" syntax, like this:
<$vars project={{##project}} autoref={{{ [{##project}addsuffix[/project]]
}}}>
Hopefully, the above code examples should get you pointed in the right
direction.
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/e9c7ec3e-ce9c-490c-9460-d476e2ba3ea6n%40googlegroups.com.