After a conversation with Tobais
https://groups.google.com/forum/#!topic/tiddlywikidev/p0epN2XlgZk it looks
like it would be much more useful for me to create a general 'if any of
these things change perform these actions' daemon instead of one that just
does math. Most of it turned out to be very simple, except for the actually
useful part where it evaluates the actions you give it. What I have is on
github here https://github.com/inmysocks/TW5-TriggerActions and will give
you a nice list of the action widgets/macros you would like it to evaluate
in the console, without actually doing anything useful.
So, to make this do something useful I need to figure out two things:
1) Is it possible to get javascript to trigger an action widget when given
the plain text string. I currently have it pull the text out of fields and
each field is supposed to have an action widget to trigger, but
unfortunately $tw.wiki.parseText("text/vnd.tiddlywiki",actionItem,"")
doesn't trigger whatever action widget expression is stored in actionItem.
I didn't really expect it to but I was hoping to get lucky. I am not sure
that what I want to do is actually possible without significant work, but I
am hoping that someone who knows more about how the core works can tell me.
2) In the same context, is it possible to set the currentTiddler variable?
Since I am not making a widget I don't think I can use the
widget.setVariable function that the set widget uses, or at least I haven't
figured out how to yet.
Said differently, I want to do the equivalent of
<$tiddler tiddler=<<someTiddler>>>
<$action-setfield text=test/>
(some list of more action widgets/macros)
</$tiddler>
in javascript where someTiddler and the action widget expressions are given
as strings, and the action widgets are triggered by the daemon when a
tiddler changes.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.