Help using "Select By Filter" script/menu

(Topic split from "Select By Filter" menu button, which has the script used below to create the menu listing filters.)


I currently have a few filters:
image

If I were to create a "Three Button" for each of them, the filter works. But when I use the .vbs.txt script Leo provided above, selecting the filter seemed to "Select All Files", as highlighted in the screenshot in orange, instead of running the filter:

I do not know enough to debug the script.

Any ideas?

Hard so say without knowing what your filters are, and what's in the button that runs the script, and information about the files that should/shouldn't be matched. Please provide more detail.

My 2019 1Q, 2Q, 3Q filters are simple Date Created matches:
image

And the button to run the .vbs.txt is as follow:
image

When, clicked, the button showed the filter:
image

Your 2019 1Q filter seems to do the opposite of what you'd want. It selects things which were not created within the first quarter of 2019.

Do your filters work properly with Tools > Find Files > Advanced? Check them there first.

My filter is working as expected:

(yes, I am not sure why I have to use "No Match" instead of "Match". It's like a negative of a negative).

Where is the second negative? It's not in the filter itself.

The filter says: Do not match things created between 1/1/2019 and 31/1/2019

If you're using that filter with Find, it should not be matching those files.

Can you show a screenshot of how the Find panel is configured, not just the results?

I am not using the filter with Find, as in Ctrl-F, Find, if this is what you mean.
I created a button which then called the filter using the function:

Select FILTER PATTERN="2019 1Q" DESELECTNOMATCH HIDESEL SHOWHIDDEN

Maybe this is the reason?

My Find panel has nothing in there:

Now the double-negative is clear. Your Select command is using HIDESEL so it hides the things that match the filter.

I'd recommend reversing the filter, so it matches the things you want to see (not the things you don't want to see), and then using HIDEUNSEL instead of HIDESEL if you want to use it with the Select command.

Then the filter can be more easily used with other things, like the Select By Filter menu you wanted to use it with at the start of the thread.

You can load your filter into the Find panel by moving the mouse over where it says "Filter: new filter" in the screenshot and clicking there (over the "new filter" part, specifically). A list of saved filters will appear.

Using the Find tool is usually the best/easiest way to test how a filter works and see what it does or doesn't match.

This is super useful. Thank you so much, Leo! <3