How to set livefilter in scripting?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
MBaas
Posts: 582
Joined: 15 Feb 2016 21:08

How to set livefilter in scripting?

Post 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? ;)
______________________________________________
Happy user ;-)

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: How to set livefilter in scripting?

Post by jupe »

This will remove any live filter, if that is what you are asking:

filter , 8;

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to set livefilter in scripting?

Post 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; }
One of my scripts helped you out? Please donate via Paypal

MBaas
Posts: 582
Joined: 15 Feb 2016 21:08

Re: How to set livefilter in scripting?

Post 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:
______________________________________________
Happy user ;-)

Post Reply