We can do this manually, by creating edit fields for the list of titles and the field/value combinations, and then writing something like this:
<$button>Make Tiddlers
<$let fieldvalues={{{ [<currentTiddler>get[fieldvalues]] }}}>
<$list filter="[{!!titles}split<newline>trim[]] :filter[!match[]] +[reverse[]]">
<$action-createtiddler $basetitle=<<currentTiddler>> >
<$list filter="[<fieldvalues>split<newline>trim[]] :filter[!match[]]" variable="fieldvalue">
<$let
name={{{ [<fieldvalue>split[:]first[]trim[]] }}}
value={{{ [<fieldvalue>split[:]last[]trim[]] }}}
>
<$action-setfield $tiddler=<<createTiddler-title>> $field=<<name>> $value=<<value>> />
</$let>
</$list>
<$action-navigate $to=<<createTiddler-title>>/>
</$action-createtiddler>
</$list>
</$let>
</$button>
On clicking the button, we save the field fieldvalues
(just because currentTiddler
will be changing, and it’s easier to get now.), split the titles
field on a newline (defined above with \function newline() [charcode[10]]
), trim each of the results, and filter out any empty lines. I also reverse this list so that when they’re added to the story river below, they’ll be shown in the order defined in your list.
For each of these titles we create a tiddler with that value as basetitle
(meaning that if we are trying to create My Tiddler
and that already exists, it will us My Tiddler 1
or My Tiddler 2
, etc.) We use our fieldvalue
variable, split it on a newline, again trimming and removing empties. Then for each one, we split on the colon, trimming the results, to give us a name
and value
, and we use these to set a field value of the current tiddler. Then we navigate to the tiddler. (If you don’t want this, you can just delete the $action-navigate
line; and if so, you might as well remove the reverse
above.)
The createTiddler-title
variable, if it’s not familiar, is set by the $action-createtiddler
widget.
This is a minimally styled tiddler demonstrating the idea: Batch Create.json (1.6 KB) You can download it and drag the resulting file onto any wiki to test. (I have some sample values in there. You can remove them with the Clear
button.) It looks like this:
After clicking: