I've two things I want to do:

1) I want to use the current date/time as part of a concatenated string for 
a new tiddler title.
2) I want to use the value of a field from the host tiddler as part of a 
concatentated string for a new tiddler title.
3) I want to use 1) and 2) at the same time for the same new tiddler.

E.g.:

A host tiddler has a field "projectnumber" and that tiddler also hosts a 
transcluded tiddler "newProjectEntry". "newProjectEntry" holds <$button>
code to create a new tiddler. Clicking the newProjectEntry button from the 
host tiddler is intended to generate a new tiddler with a title "2018-02-01 
09:57:04, 12345, Project entry:" where:

   1. "2018-02-01 09:57:04" is the value from <<now ...>> when the button 
   is clicked.
      1. Issue 1: I can get a date/time string, but it is the date/time AT 
      THE TIME that tiddler "newProjectEntry" is rendered in the host tiddler, 
      not at the time the button was pressed.
      2. Issue 2: Otherwise, I get the text string "<<now ...>>" instead of 
      the rendered version for <<now ...>>.
      3. Issue 3. Or otherwise, I get the proper date/time, but am unable 
      to concatenate a looked-up project number.
   2. "12345" is the value of host tiddler's projectnumber field.
      1. Issue 1: I can get the host tidder's title ("<<storyTiddler>>"), 
      but the construct "<<storyTiddler!!projectnumber>>" doesn't seem to work.
   3. "Project entry:" (and the other spaces and commas) are text literals.
      1. No issues here. I've mostly had sufficient guidance on how to 
      concatenate things. So far. I think.
   

What I've written:

Tiddler 1 fields:

> Title:hostTiddler
> projectnumber:12345
> Text:{{newProjectEntryPB}}
>

Tiddler 2 fields:

> Title:newProjectEntryPB
> Text:\define projecttitle() $(todaynow)$, $(projectnum)$, Project entry:
>
> <$set name="todaynow" value=<<now "YYYY-0MM-0DD 0hh:0mm:0ss">>>
> <$set name="projectnum" value={{<<storyTiddler!!projectnumber>>}}>
>
> Need a new project entry? Click this button and a project tiddler will be 
> created:
> <$button>
>       New project entry
>       <$action-sendmessage
>          $message="tm-new-tiddler"
>          title=<<projecttitle>>
>       />
> </$button>
>
> </$set>
>

When the button is clicked from within hostTiddler, it generates a new 
tiddler with the title:
2018-02-21 18:36:34, , Project entry:

1) Issue: The date/time is not current with the button press.
2) Issue: Unable to get the project number value from the host tiddler.

Thanks much for your help!

Mark Hylton

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c93fd420-8fd0-4c20-a968-12ed3dc0ec23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to