Aigars,
Not exactly answering your question but
this discussion resulted in the sharing of the following "macros" that may be of use;
In this case the Button is used to trigger the action widget action-sendmessage. So a Question someone could answer is how to trigger action widgets from Javascript?.
Best of Luck
Tony
\define closeByFilter(filter)
filter: $filter$
<$button>
close filtered tiddlers
<$list filter=$filter$>
<$action-sendmessage $message="tm-close-tiddler"/>
</$list>
</$button>
\end
\define openByFilter(filter)
filter: $filter$
<$button>
open filtered tiddlers
<$list filter=$filter$>
<$action-navigate $to={{!!title}}/>
<$action-sendmessage $message="tm-unfold-all-tiddlers"/>
</$list>
</$button>
\end