Please help with a "complex" then else filter

42 views
Skip to first unread message

Tony K

unread,
May 22, 2020, 2:56:23 AM5/22/20
to TiddlyWiki


i have this filter

       [regexp:title<pattern>] [regexp:text<pattern>] -[all[current]backlinks[]] -[is[current]] -[tag[hide]] -[is[system]]

and it is working fine, however if I want to make it a "true"/ "false" variable


    <$vars    isFreelink = {{{ [regexp:title<pattern>] [regexp:text<pattern>] -[all[current]backlinks[]] -[is[current]] -[tag[hide]] -[is[system]]then[true]else[false] }}} >


it is giving me a syntax error

Is this multi - parts filter supported with the if then else?

thank you 

Saq Imtiaz

unread,
May 22, 2020, 3:01:08 AM5/22/20
to TiddlyWiki
try:

{{{ [regexp:title<pattern>] [regexp:text<pattern>] -[all[current]backlinks[]] -[is[current]] -[tag[hide]] -[is[system]] +[then[true]else[false]] }}}

Tony K

unread,
May 22, 2020, 3:02:28 AM5/22/20
to TiddlyWiki
Man you are so quick it is not even funny

thank you so much 

Mat

unread,
May 22, 2020, 3:07:42 AM5/22/20
to TiddlyWiki
Since your first filter works, I guess it is not the problem but just to make sure:
  • I don't think there can be spaces next to the equal sign. Or I just learned something new.
  • There are some differences between the SetWidget and the VarsWidget where the former is somewhat more powerful. Can't recall details. Anyway, you could see if it happens to work using the SetWidget instead.
<:-)

Joshua Fontany

unread,
May 22, 2020, 3:09:46 AM5/22/20
to TiddlyWiki
Syntax gremlins (they bug me too). "Runs" (sequences of filter operators) should be wrapped in square brackets, so


-[is[system]]then[true]else[false]

Should be

-[is[system]then[true]else[false]]


But I'm not sure that's going to do what you want.... AAah, Saq found the syntax, good.

Best,
Joshua Fontany

TonyM

unread,
May 22, 2020, 8:46:31 AM5/22/20
to TiddlyWiki
Joshua

I believe saqs form is nessasary because it must be a seperat run to operate on all tiddlers resulting from all previous runs not only the
[is[system]here]

Do tell me so if I got it wrong.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages