Question about generating tiddlers from dictionary tiddler.

132 views
Skip to first unread message

Rizwan Ishak

unread,
Sep 6, 2016, 1:28:10 PM9/6/16
to TiddlyWiki


This contains several questions, please be patient.



Say, there is a dictionary tiddler with title "Fruits" and having content.

Apple:Red
Mango:Yellow
Grapes:Purple
Watermelon:Green


I am trying to generate, on a single button click, four tiddlers with titles Apple, Mango, Grapes and Watermelon.

With the code
<$button>
<$list filter="[title[Fruits]indexes[]]" variable="index">
<$action-sendmessage $message="tm-new-tiddler" title="<<index>>"/>
Multiple Tiddlers, Yay!!
</$button>

I was able to generate drafts of 4 tiddlers with the required names. But I didn't want them to open for editing or appear in the storyriver - just be created silently.
I tried using make plugin from Tobibeer as

<$button>
<$list filter="[title[data]indexes[]sort[title]]" variable="index">
<$action-setfield $field=notetext $value=<<index>> />           ================> coz I read 'make' plugin won't accept anything but default macros.
<$list filter="[[]make[{{!!notetext}}]]"/>
</$list>
Multiple Tiddlers, Yay!!
</$button>


| am not quite  sure I nailed that syntax. I am not even sure this is how to use it.


Questions
1. The button widget attribute set/setTo which will allow you to generate a new tiddler silently given that no tiddler target is given and set=title is specified, how do I replicate the same here? Or is there some other way? I guess that way I can store most of my read only data in a dictionary format and generate tiddlers only when necessary.
2. List filter in the above codes as "[title[Fruits]getindex[]]" returns absolutely nothing. If I understand correnctly, it should return the other side of colon, right? May I know what am I doing wrong?
3. Can there be something like "Stupid Questions Saturday" or something where absolute noobs can ask questions without fearing to be a botheration?







Mark S.

unread,
Sep 6, 2016, 2:26:06 PM9/6/16
to TiddlyWiki
In your first case, you weren't assigning a title. Every tiddler needs a title. This code seemed to do the trick:

<$button>
<$list filter="[[Fruits]indexes[]sort[title]]" variable="index">
<$action-setfield $field="title" $value=<
<index>> />
</$list>
Multiple Tiddlers, Yay!!
</$button>


getIndex appears to need a property. So something like this worked:

<$list filter="[title[Fruits]getindex[Apple]]" ><$view field=title/></$list>


As far as I can tell, most every day is Stupid Questions Saturday ;-)

HTH
Mark

Rizwan Ishak

unread,
Sep 6, 2016, 9:54:46 PM9/6/16
to TiddlyWiki
Thank you!!!



Matabele

unread,
Sep 7, 2016, 2:26:15 AM9/7/16
to TiddlyWiki
Hi Rizwan

I created a plugin for precisely this purpose -- head over to the MakeTid plugin wiki to see some examples. 

I put this up in a hurry for someone else -- there are brief docs in the Preferences/Plugins tab. The maketid[] filter is a stripped down version of Tobias's make[] filter -- this works together with the Maketid widget to create one or more tiddlers with a single button click. For your purposes, feed the list of titles into the maktid[] filter.

regards

Rizwan Ishak

unread,
Sep 7, 2016, 5:00:17 AM9/7/16
to TiddlyWiki
Absolutely fantastic. Does the whole thing in a line!.

Danielo Rodríguez

unread,
Sep 7, 2016, 5:20:41 AM9/7/16
to TiddlyWiki


El miércoles, 7 de septiembre de 2016, 8:26:15 (UTC+2), Matabele escribió:
Hi Rizwan

I created a plugin for precisely this purpose -- head over to the MakeTid plugin wiki to see some examples. 

I put this up in a hurry for someone else -- there are brief docs in the Preferences/Plugins tab. The maketid[] filter is a stripped down version of Tobias's make[] filter -- this works together with the Maketid widget to create one or more tiddlers with a single button click. For your purposes, feed the list of titles into the maktid[] filter.

This is a beautiful shortcut! Correct me if I'm wrong but it's like merging the action-setfield widget, action-listops and action-navigate, right?

Regards 

Matabele

unread,
Sep 7, 2016, 2:54:18 PM9/7/16
to tiddl...@googlegroups.com
Hi Danielo

Yes -- it contains bits of code from the ActionSetfield and ActionListops widgets -- then a bit left over from my old MakeTid widget (the navigate bit) and gets a great big boost from Tobias's make[] filter. Actually, Tobias's filter was the inspiration for rewriting the widget -- essentially, because the filter can pre-generate titles, the widget could be re-written as an action widget.

regards
Reply all
Reply to author
Forward
0 new messages