How to set a tiddly field with the output of a macro call

Hi,

I want to set a field with the content resulting from a list of tiddler
I’ve got inspiration from Macro: Produce a Delimited List

I’ve elaborated the following code but this does not work …

\define dlist(filter, delimiter:", ")
<$list filter="$filter$ +[join[$delimiter$]]">
<$text text=<<currentTiddler>> />
</$list>
\end

\define compute_sum()
<$action-setfield $tiddler=<<currentTiddler>> list_tiddlers_filter=<<dlist "[tag[project]limit[4]]">>/>
\end

<$select tiddler=<<currentTiddler>> field="projectId" actions=<<compute_sum>> >
<$list filter='[tag[project]]:or[tag[archived]]:and[sort[title]]'>
<option value=<<currentTiddler>>><$view field='title'/></option>
</$list>
</$select>

A field called list_tiddlers_filter is created but it contains <$list filter="[tag[project]limit[4]] +[join[, ]]"><$text text=<<currentTiddler>> /></$list> … where I’m looking for the real list of tiddlers

As if the result of the macro call (that I tested alone and which works) <<dlist>> was not interpreted.

Any magic idea …!!! I’m blocked …

Thanks again for your help

Regards

If you want to use the output of a macro you need to wikify it before using it;

However there are more options in Tiddlywiki 5.3.x, which are you using?

Last one of course !
Which other options are existing ?
Thanks very much

Vpl

If you can state what you want in a filter use the new function

\function dlist(filter delimiter:", ") [subfilter<filter>] +[join<delimiter>]

There are different ways we can now use functions. When used as a value to an attribute it only gives the first result, such as when you are setting a field value. However your use of join effect it forces the whole output to be the first value.

<<dlist "[tag[TableOfContents]]" ", ">>

or

<$action-setfield $tiddler=<<currentTiddler>> list_tiddlers_filter=<<dlist "[tag[project]limit[4]]">>/>

You can see that in many cases this will be better than using macros.

And this works …!!

Thanks a lot for your so quick help & support

Regards