Hi Antaneus, you ca this.getVariable("
On Saturday, October 3, 2015 at 10:53:12 PM UTC+1, Antaeus Feldspar wrote: > > Tobias, Mark, thank you for your suggestions... The use of SetWidgets to > set variables is something I didn't understand before, and I can tell I'll > eventually be able to use it to achieve a much cleaner solution. > > Right now, though, I still have a problem that's completely blocking me: > how do I get the *results* of a macro call into a variable? > > The project I'm working on will involve dates. I can write a macro in > Javascript which takes a date in TW's format and adds or subtracts a given > amount of time. But how can I have TiddlyWiki call that macro *and* store > it in a field rather than simply rendering the result on the screen? > You should be able to use Tobias suggestion <$set name="js-macro-link-text" value={{!!test}}> <$button set=!!test setTo=<<js-macro-link>>>Test button</$button> </$set> In your javascript macro you can read the value of "js-macro-link-text" like so: var input = this.getVariable("js-macro-link-text"); cheers BJ -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3f2fdefd-6dc0-4243-90a2-754753ff0653%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.