Page 1 of 1

How to set livefilter in scripting?

Posted: 09 Jan 2021 00:57
by MBaas
I'm still working on my "New File"-Project and noticed a possible problem: when user calls this function in a state where a LiveFilter is set, the new file may not appear (because the filter may not apply to it).

My current plan is to just reset the LiveFilter if get("livefilter"); returns anything.
I did not find any means to set the livefilter, but finally found #389, so I guess I'll just call that.

Would be curious about some Pro-Feedback (just to learn a bit):
how would guys deal with that situation? Am I missing anything here? ;)

Re: How to set livefilter in scripting?

Posted: 09 Jan 2021 01:04
by jupe
This will remove any live filter, if that is what you are asking:

filter , 8;

Re: How to set livefilter in scripting?

Posted: 09 Jan 2021 01:06
by highend
And filter is also used to set it again (so store it in the first place...)

Code: Select all

    $lfb = get("livefilter");
    filter "", 8;
    // do something
    If ($lfb != "") { filter $lfb, 8; }

Re: How to set livefilter in scripting?

Posted: 09 Jan 2021 11:41
by MBaas
What, that simple? :oops:

I actually did a find on the "scripting commands"-help, but I don't remember what obscure term I looked for. Oh, I remember...
because we have get("livefilter"), I thought about set("livefilter") and (as "set" seemed to do something else - unless there is a variable for my purpose) continued to search for "livefilter", but did not think about using "live filter" :whistle: