Yes, concatenation can be confusing. Often you have to take the different pieces, and then put them together in a macro. This version seems to work:
\define dream-log-title() Dream Log $(today)$ \end \define dream-log-button() <$vars today=<<now "YYYY-0MM-0DD">> > <$button>New Dream Log <$action-sendmessage $message="tm-new-tiddler" title=<<dream-log-title>> tags="[[$(currentTiddler)$]]"> </$button> </$vars> \end <<dream-log-button>> On Tuesday, May 26, 2020 at 2:01:34 PM UTC-7, Ed Heil wrote: > > This has been driving me batty and makes me hope there is a simple > solution I'm missing. > > I have a button which is supposed to create a new tiddler named "Dream Log > YYYY-MM-DD" tagged with the current tiddler. > > It looks like this and NEARLY works: > > \define dream-log-button() > <$button>New Dream Log > <$action-sendmessage $message="tm-new-tiddler" title=<<now "Dream Log > YYYY-0MM-0DD">> tags="[[$(currentTiddler)$]]"> > </$button> > \end > > <<dream-log-button>> > > The only problem is, if you click the button after noon, it creates a > tiddler titled "Drepm Log 2020-05-26" because "am" is significant to the > "now" macro. > > I've been going in circles trying to figure out how to concatenate the > string "Dream Log " to the result of the macro call <<now "YYYY-0MM-0DD">> > and feed that into the "title" attribute of the action-sendmessage. But > I'm not quite getting it. I figure I must be missing something simple, > since this seems like a simple thing. > > I've tried this: > > \define dream-log-title() > Dream Log <<now "YYYY-0MM-0DD">> > \end > \define dream-log-button() > <$button>New Dream Log > <$action-sendmessage $message="tm-new-tiddler" title=<<dream-log-title>> > tags="[[$(currentTiddler)$]]"> > </$button> > \end > > > but that just gives me a tiddler named "Dream Log <<now "YYYY-0MM-0DD">>" > > I've been banging around switching <<>> for <$macrocall>s, creating > variables and trying to interpolate them into macros, and so on, but so far > haven't got it right. > > Can somebody point me in the right direction? > -- 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/f481fbc1-f933-4098-9d4f-bbdca66dc937%40googlegroups.com.

