TW5: macros inside macros?

58 views
Skip to first unread message

Dave

unread,
Nov 8, 2015, 1:43:28 AM11/8/15
to TiddlyWiki
Hi,

I want to be able to do something like this in a macro:

<<races event:"$(currentTiddler)$-<<now YYYY-0MM-0DD>>">>

...in order to have the macro variable $event$ (or is that called a parameter?)  to be equal to the current tiddler + the date/time right now, like "test tiddler - 2015-11-07"

I tried the above and the value for $event$ reverts to its default.

I also tried $(now)$ but that didn't work either.  I know in TWC something like that would work if you used "\" in front of each ">" inside the outer ones, but that doesn't work either.


Is this acheivable?
Thanks,
-Dave


Eric Shulman

unread,
Nov 8, 2015, 2:31:06 AM11/8/15
to TiddlyWiki
The $macrocall widget allows you to use other macros to specify the parameter values.

Try this:
\define event(what,when) <<races event:"$what$ - $when$">>
<$macrocall $name="event" what=<<currentTiddler>> when=<<now YYYY-0MM-0DD>>/>

enjoy,
-e

Dave

unread,
Nov 8, 2015, 9:51:52 AM11/8/15
to TiddlyWiki
Perfect, thank you!
Reply all
Reply to author
Forward
0 new messages