Thanks for replying Mark.
This is for EditorMagic (which will get a public status update later today.
It's getting good but still has big problems) and it would be neat if the
two tools therein that rely on what I'm asking about in the OP here would
work properly.
Here's the idea, albeit simplified:
As anyone, understandably, have forgotten by now, EditorMagic is a set of
tools in the editor. Among these, there should be a possibility to create
another, new, tiddler - directly from within the current editor - and and
have that new tiddler be transcluded into the current one. I.e if the
current tiddler is titled Foo, then what should end up in the current
tiddlers text is {{Foo 1}}..
So, here's my current (flawed) solution. Imagine that it is an
EditViewTemplate, i.e accessible in edit mode:
<$edit-text tiddler="temp" />
<$button>
Insert as transclusion
<$action-createtiddler $basetitle=<<currentTiddler>> text={{temp}} />
<$wikify name=newest-tid
text={{{ [prefix<currentTiddler>!sort[created]first[]] }}}
>
<$action-setfield
$tiddler=<<currentTiddler>>
text=<<some macro call to wrap Newest-tid in transclusion braces.
This is not the problem.>> />
</$wikify>
<$action-deletetiddler $tiddler="temp"/>
</$button>
I suspect that the action-createtiddler is not finished by the time that
wikify does its thing. So wikify doesn't get the new title, in spite of my
hackey filter. If "newest-tid" could instead be named "Foo n"
indenpendently of if it exists, then this would be solved because that is
the string to insert even if the tiddler doesn't yet exist for another
second.
Of course, the real problem might be why action-createtiddler is not
finished before the next widget is executed, but I believe that is a known
bug or flaw in TW. (Right?)
I'd love to hear if you have better strategy than the above hack. It
doesn't have to be perfect, just work, because the goal is to make
EditorMagic good enough to convey the concept properly not to have it
perfect.
Thanks!
<:-)
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/afbbb171-edc2-4bbe-b114-457c0b651949o%40googlegroups.com.