It’s a bit tricky since we do have a core <<unusedtitlemacro
which has 3 parameters and the first one should be a <<now
macro call. Nesting macros is tricky. So in this case the $wikify-widget
is a possibility to create some readable code.
-
We use the new text substitution option for widget parameters, to create the unusedtitle-macro-string, that can be wikified by the wikify-widget
-
We start with a function:
\function utNow() [<now "YYYY0MM0DD">]
to get the<<now
macro out fo the way. It will be used by the text-substitution later -
the
text
-parameter of the wikify-widget uses 5 elements
a) macro name …<<unusedtitle
b) 1st macro parambasename:"$(utNow)$"
c) 2nd macro paramseparator:"_"
d) 3rd paramtemplate:"$basename$$separator$$count:4$"
… to create the title
e) closing the macro started at a)>>
-
template description can be found at the unusedtitle Macro tiddler
\function utNow() [<now "YYYY0MM0DD">]
\procedure testCreate()
<$wikify name="getTitle"
text=`<<unusedtitle baseName:"$(utNow)$" separator:"_"
template:"$basename$$separator$$count:4$" >>`
>
<$action-createtiddler $basetitle=<<getTitle>> />
</$wikify>
\end
<$button actions=<<testCreate>> >
Create Tiddler
</$button>
createtiddler-using-unusedtitle-and-now-macro.json (488 Bytes)
hope that makes sense.
-mario