True but it's not that. I acn this of a kludge though. Since editProject is called but too uoon (immediatly), I could instead called a new macro callEditProjectASAP which would basically see if the new item is there until it is, with a sleep inbeween. and then call editProject. Not so simple IRL surely, for sleeping is not so simple in JS, needs a bit of things to do but tgen the problem is...
how can I code a javascript macro in TW5? Is it possible? even more murky: make it call js through a filter. just as a way to call js if nothing else.or as regular html launched js (<script>). All this seems promising of js fiddling I'd better avoid. Although I'd really like to know how to code a js macro. Le jeudi 6 mai 2021 à 15:37:03 UTC+2, PMario a écrit : > Hi, > I didn't test anything and also didn't read the code. .... BUT 1 end > </$set> is missing. > -m > > On Thursday, May 6, 2021 at 2:24:11 PM UTC+2 [email protected] wrote: > >> In my project I need to first create a new project with an identifier (an >> input data) then to offer a complete input of the project to the user. >> >> I have crafted this macro invoked when the identifier is ready to be used. >> >> \define insertProject(proto) >> <$set name=project select=0 filter="[all[current]getindex[project]]"> >> <$action-setfield $tiddler=<<target>> $index=<<project>> $value=""/> >> <$set name=autoref select=0 filter="[<project>addsuffix[/project]]"> >> <$action-setfield $tiddler=<<target>> $index=<<autoref>> >> $value=<<project>>/> >> <$macrocall $name=editProject proto="$proto$" target=<<target>> >> id=<<project>>/> >> </$set> >> \end >> >> this does indeed create an index within the data tiddler with the desired >> value. Then it prepares the data for the further input. So far so good. But >> the second input does nothing. With additional logging, it is shown that in >> fact this last part is called first! (this is the call to editProject). >> >> I wonder wether that is but an illustration that in TW the order of the >> treatments cannot be guaranteed? >> >> Anyway. can I achieve my goal? And how? >> >> In the meantime, I'll just setup a message to do the edit by hand. >> >> Could we dream of callbacks for action, that would be called after the >> action is done? >> >> something like <$macrocall $name=insertProject $chaining=editProject/> >> >> surely it would use variable instead of parameters as a way not to have >> too cumbersome a syntax in the macrocall. And it may very well not be on >> offer for a direct call like <<insertProject>>. >> >> Regards. >> >> -- >> Jean-Pierre >> > -- 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/b12ea33d-bd84-4adf-b59c-9a43513b2b14n%40googlegroups.com.

