It would be nice to have a reverse function of enlist that would take a list of titles and output a single title for enlist to act upon it ad returns the original list.
It would allow to pass a list of titles as a single arguments. If there is no space in the titles, one could use join[ ]
as a substitute but in many a case there will be spaces!
I have been able to have this functionality with a function. See below and after that, my comments.
\function .prepareTitle()
=[charcode[91],[91]]
[all[]]
=[charcode[93],[93]]
+[join[]]
\end
\function .tolist()
[all[]]
:map[search:title:literal[ ]then<.prepareTitle>else<currentTiddler>]
+[join[ ]]
\end
\define importTitles()
<$let those={{{
[tag{!!tagged}]
+[dump[ball tagged]]
+[.tolist[]]
}}}
>
<$action-setfield got=<<those>>/>
</$let>
\end
<label>tag to be looked for <$edit-text field=tagged/></label>
<$button actions=<<importTitles>>>import titles with that tag</$button>
into field "got": <$view field=got/>
This function works nicely BUT it needs an auxiliary function. If I tag $:/tags/Macro
the above tiddler, it will also export that one. I can setup an other tiddler to just import that auxiliary function but it’s a bit tedious. If anyone is able to make it without an auxiliary function, let they show it!
BTW it’s a bit awkward to export function by tagging $:/tags/Macro
. Sure, it does the job. But it would have been a perfect fit to tag $:/tags/Function
instead (both macros could be used at the same time.