I'm trying to create tids from a list

I have a tiddler called ListofTitles containing

TiddlerOne TiddlerTwo Tiddler Three TiddlerFour

I have another with

\define createtiddlers()
<$list filter="[enlist<currentTiddler>]">
<$action-createtiddler $basetitle=<<currentTiddler>>/>
</$list>
\end

<<createtiddlers ListofTitles>>

can’t get it to work. - Please assist.

[Edited to wrap your code]]

Try this:

\define createtiddlers(tid)
<$list filter="[<__tid__>get[text]enlist-input[]]">
<$action-createtiddler $basetitle=<<currentTiddler>>/>
</$list>
\end

<$button actions="<<createtiddlers ListOfTitles>>">go</$button>

Notes:

  • In order to trigger actions, you need a $button widget.
  • Your `<<createtiddlers …>> macro call passes in the name of the tiddler containing the list of titles. Thus, your macro definition needs to declare a parameter (e.g., “tid”) so you can reference this passed in value.
  • Within the $list widget’s filter parameter, <__tid__> refers to the passed in value, get[text] retrieves the contents of that tiddler, and enlist-input[] converts the text into a list of space-separated titles to be processed.
  • Also, I note that the list of titles in your example includes a title with spaces (“Tiddler Three”). In order to handle this as a single title, it needs to be enclosed in doubled square brackets. Thus, the contents of “ListOfTitles” needs to be:
TiddlerOne TiddlerTwo [[Tiddler Three]] TiddlerFour

enjoy,
-e

4 Likes

Thank you Eric, I appreciate your help. I tried your solution, but still cannot get it to work. I’m using TW v 5.2.3 with Bob together with the streams plugin.

The tiddlers are not opened automatically. So did you have a look at the Recent Sidebar tab. They should be there.

What do you try to achieve other than creating the tiddlers?

Thanks - they aren’t in the Recent Sidebar tab.

I’m interested in using lists so that I can set up a group of tasks taken (copied) from a column in an excel table. These all have the same prefix to help me track them.

Hi @hsteve11

What is the name of your tiddler containing the titles? In the OP you wrote “ListofTitles” while @EricShulman code uses ListOfTitles (notice the uppercase “o”).

Hope this helps,

Fred

2 Likes

Hi Fred

Thanks - It works! I matched the tiddler name as you suggested and it fixed the problem.

Steve