Regrettably I still can't seem to accomplish what I want:
I got the following to pass the current tiddler title to the macro:

<$vars arg=<<currentTiddler>> tmp=<<reduce title:$(arg)$>>>
<$button class="tc-btn-invisible">
<$action-sendmessage
        $message="tm-edit-text-operation"
        $param="replace-all"
        text=<<tmp>>
/>
{{$:/plugin/ajh/reduce/image}}
</$button>
</$vars>

but I think what I want is to either pass the current text field to the
macro or somehow get the macro to pull the text field information before
manipulating and returning the reduced text. This seems impossible. Maybe
I'm looking at this all wrong. I wish there was a <<currentText>> or
something. All I want to do is the following:

    var text = $tw.wiki.getTiddlerText(title);
    var zwrds = text.toLowerCase().replace(     /\W/g," ");
    var ztrc = zwrds.split(" ").sort().reverse();
    var zntrc = " ";
    var add = "";
    for (var i = 0; i < ztrc.length; i++) {
        if (zntrc.indexOf(ztrc[i]) < 1) {
            add = ztrc[i].toString();
            zntrc += add;
        }
    }
    var t= zntrc.slice(1);
    return t;


On Thu, Mar 10, 2016 at 4:11 AM, Mat <matiasg...@gmail.com> wrote:

> I'm pretty sure that this bit won't work:
>>
>> text=<<reduce "$(mytext)$">>
>>
>>
>
> I just recently did a lot of experimenting and (1) assuming that the above
> in deed is the problem, and (2) that I don't misunderstand the issue then
> FWIW here's a setup that I do get to work. The idea is to externalize the
> invocation with a $set and then, inside the widget, call the "name" of the
> set variable instead. Please tell me if I'm missing the point/issue when
> suggesting this.
>
> Example:
>
> title:Foo
> test: (blank)
>
> \define foo() This is $(arg)$
>
> <$set name="arg" value="myarg">
> <$set name="tmp" value=<<foo>>>
> <$button>
>     <$action-setfield
>               $tiddler="Foo"
>               test=<<tmp>>
>     />
> Click
> </$button>
> </$set>
> </$set>
>
> test = {{!!test}}
>
>
> <:-)
>
> --
> 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 https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/f1743db2-8d22-494a-950c-e91bf062fd56%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/f1743db2-8d22-494a-950c-e91bf062fd56%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAL0r7zsZS2if0yLv8VgA4j6OEbjEu4L%3DPbMwdRH5rMyQbt3cbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to