[TW5] Q: Passing transcluded field of a variable tiddler as value to ActionSetFieldWidget

83 views
Skip to first unread message

hobbyist writer

unread,
Jun 23, 2015, 8:50:40 PM6/23/15
to tiddl...@googlegroups.com
Hi

I need to copy the text field of a tiddler into a specific field of another tiddler. The tiddler titles are not known beforehand, because they are temporarily created and deleted on-demand with almost arbitrary (time-stamped) titles. So their names are passed by variables through SetWidget.

<$button>
COPY
<$action-setfield $tiddler=<
<TiddlerA>> $field="text" $value={{<<TiddlerB>>!!refs}}/>
</$button>

The code above generates an empty filed refs in TiddlerB. When I wrap the transclusion in a macro like {{$(TiddlerB)$!!refs}}, what I see is the text {{actualNameOfTiddlerB!!refs}} in the refs filed of TiddlerB.

Your help will be much appreciated.


Mehdi

Jed Carty

unread,
Jun 23, 2015, 9:39:02 PM6/23/15
to tiddl...@googlegroups.com
One way to do this is using the tiddler widget like this:

<$tiddler tiddler=<<TiddlerB>>>
<$button>
COPY
<$action-setfield $tiddler=<<TiddlerA>> $field="text" $value={{!!refs}}/>
</$button>
</$tiddler>

This may be able to be done using variables and macros, but the tiddler widget is a much simpler fix in this case.

hobbyist writer

unread,
Jun 23, 2015, 11:32:48 PM6/23/15
to tiddl...@googlegroups.com

<$tiddler tiddler=<<TiddlerB>>>
<$button>
COPY
<$action-setfield $tiddler=<<TiddlerA>> $field="text" $value={{!!refs}}/>
</$button>
</$tiddler>

It works. Thanks a lot, Jed.

Meanwhile I encountered another issue. I'm not sure if I have to open another post. Anyway, I just go ahead and ask here first.

I would like to prepped the text field of TiddlerX to the text field of <<TiddlerB>> and then append the text field of TiddlerY to the text field of <<TiddlerB>>. All of this happens programmatically from within another (a fourth) tiddler.

Do you happen to know the answer to this?


 
Reply all
Reply to author
Forward
0 new messages