Ed,

I would also enhance Marks Solution with one more field in the new tiddler 
actionWidget
log-date=<<now "YYYY0MM0DD0hh0mm0ss0XXX">>

<$action-sendmessage $message="tm-new-tiddler" title=<<dream-log-title>> 
tags="[[$(currentTiddler)$]]" log-date=<<now "YYYY0MM0DD0hh0mm0ss0XXX">> >

Then it will be far easier to interrogate the date of log entries going 
forward. You could even change the title to be more reader friendly because 
you have the real and editable date in the log-date field.

Regards
Tony

On Wednesday, May 27, 2020 at 7:25:23 AM UTC+10, Mark S. wrote:
>
> 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/d4e4968a-1e79-49d3-8485-e7b336be9faa%40googlegroups.com.

Reply via email to