Do explain why you want a macro, Is it for reusable code? I will provide a different solution to yours once I understand more. I did learn by reviewing the core buttons in tiddlywiki, search the shadow tiddlers, they can be simplified further.
It seems to me in this case the macro is almost as "verbose" as the button widget. Sometimes pasting a snippet is just as quick. I also tend get many of the values used from elsewhere, such as fields and variables, you will need to use the macrocall widget to do this. Regards Tones On Saturday, 5 December 2020 at 03:50:45 UTC+11 [email protected] wrote: > Hello, > > I have a question about creating a macro. > https://tiddlywiki.com/static/Macros%2520in%2520WikiText.html > > I have to make a lot of buttons in my wiki and I have this code for a > button for creating a new tiddler; (It works fine.) > > `<div style="float:left;"><$button><$action-sendmessage > $message="tm-new-tiddler" title=<<now format:"TITLE-TIDDLER-HERE">> > tags="TAG-NAME-HERE" tags show="TAG-NAME-HERE" text="TEXT-HERE" > comment="FIELD-COMMENT-HERE"/><span > style="color:blue;">''BUTTON-NAME-HERE''</span></$button></div>` > > How do I convert the above code into a macro? > > This is my attempt, but I can't get it done: > > `\define NEW-TIDDLER(now format:"XXX" > tags:"XXX" tags show:"XXX" text:"XXX" comment:"XXX") > <div style="float:left;"><$button><$action-sendmessage > $message="tm-new-tiddler" title=<<$now format:$>> $tags$ $tags show$ $text$ > $comment$/><span > style="color:blue;">''BUTTON-NAME-HERE''</span></$button></div> > \end > > <<NEW-TIDDLER > now format:"XXX" > tags:"XXX" > tags show:"XXX" > text:"XXX" > comment:"XXX" > ">>` > > Thank you, > > > > -- 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/1ac88fb4-1eb9-47f8-8900-739ae9b461ean%40googlegroups.com.

