Power Filter XYTB Command (Images >50KB Size) Help

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
total_annihilation00
Posts: 12
Joined: 24 Apr 2023 04:16
Location: 0xC000021A
Contact:

Power Filter XYTB Command (Images >50KB Size) Help

Post by total_annihilation00 »

I'm trying to filter certain Image Filetypes above 50KB, seems simple enough, but when I try "*.jpg;*.jpeg;*.png*.bmp;*.gif;*.webp AND size: > 50 KB" it doesn't work. Only way I got it to work was "size: > 50 KB & name: *.jpg; size: > 50 KB & name: *.jpeg; size: > 50 KB & name: *.png; size: > 50 KB & name: *.bmp; size: > 50 KB & name: *.gif; size: > 50 KB & name: *.webp;" So my questions is, is there a way to group the file extensions and AND each of them with the Size query without extraneously entering each test separately? This seems too complicated, I need a compact way to do this (also would make changing the FileSize only one edit)! Oh and I don't want to do the following, I want to be able to specify each filetype explicitly, even though this works: "{:Image} AND size: > 50 KB" I'll consider using RegEx if it can be done with it.
P.S: Seems like buggy Filter Syntax (as brackets aren't supported yet), probably needs thorough fixing…
I'm using the XYplorer: 28.00.0300 (64-bit) Portable on OS: Windows 10 Enterprise, 64-bit, Version 22H2, Build 19045.6396 (10.0)
Image
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down, Then We Melt Their Plastic Town~

WirlyWirly
Posts: 312
Joined: 21 Oct 2020 23:33
Location: XY 64-Bit | Win 10 @ 100% (3440x1440)

Re: Power Filter XYTB Command (Images >50KB Size) Help

Post by WirlyWirly »

It would be great if we could do it all from one quicksearch by combining both regex and booleans, such as...

>\.(png|webp|jpeg|svg)$ AND "size: > 50KB"

However, since that doesn't work, the simplest way I know of to do this (Besides using the "Find Files" tab) is to run TWO quicksearches; The first search will find all the desired filetypes, the second search will narrow down those results to the desired filesize.

Paste this into your address bar...
::goto "?>\.(png|webp|jpeg|svg)$"; goto "#?size: > 50KB";

The first search invokes a regex quicksearch for the specified filetypes. The second quicksearch will search for the specified filesize against the current list items, which will only be the images that first regex search just found.

This works thanks to XY's "Search in List" feature, which lets us quicksearch through a specific list of files. The # in this case is shorthand for <allitems |>, which basically means "a list of all the items in the current pane", which again will only be the results from our previous regex search.

total_annihilation00
Posts: 12
Joined: 24 Apr 2023 04:16
Location: 0xC000021A
Contact:

Re: Power Filter XYTB Command (Images >50KB Size) Help

Post by total_annihilation00 »

Thank you! This works, but the catch is it searches through all subfolders though. :D
Image
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down, Then We Melt Their Plastic Town~

WirlyWirly
Posts: 312
Joined: 21 Oct 2020 23:33
Location: XY 64-Bit | Win 10 @ 100% (3440x1440)

Re: Power Filter XYTB Command (Images >50KB Size) Help

Post by WirlyWirly »

You can set the /maxdepth=0 flag during the first search so that it only searches the current directory...

::goto "?>\.(png|webp|jpeg|svg)$ /maxdepth=0"; goto "#?size: > 50KB";

Like I mentioned, you might try the "Find Files" tab, which will let you do this search pretty easily and with no scripting...

"Edit > Find Files..."

Also, the /types flag works if you don't use regex...

size: > 50KB /maxdepth=0 /types=png;jpg;webp

total_annihilation00
Posts: 12
Joined: 24 Apr 2023 04:16
Location: 0xC000021A
Contact:

Re: Power Filter XYTB Command (Images >50KB Size) Help

Post by total_annihilation00 »

That's brilliant —thanks! Works like a charm! :tup:
Image
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down, Then We Melt Their Plastic Town~

Post Reply