Color Filters

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Meester
Posts: 24
Joined: 18 Jun 2010 23:18

Color Filters

Post by Meester »

I have several color filters based on groups of file names. I thought I would add a background color based on the age of a file. I was hoping that with a query that had the background cleared would work along side another query that had the text cleared. For example:
+*.png;*.jpg;*.gif;*.tif;*.tiff;*.bmp;*.ppt;*.jpeg;*.sid;*.ecw;*.jp2;*.psd>EA0000,(no color)
ageM: 0 d>(no color),FFFF00

That logic doesn't work so I tried combining them in to one line. Like the following:
(*.png;*.jpg;*.gif;*.tif;*.tiff;*.bmp;*.ppt;*.jpeg;*.sid;*.ecw;*.jp2;*.psd) AND (ageM: 0 d)>EA0000,FFFF00
I added the Parethesis because the ; represents an OR. I want all images created today to be queryed.

I now realize that I will have to add the Age after each file string like the following:
*.png AND ageM: 0 d OR *.jpg AND ageM: 0 d OR etc.
But that will take a long time since I have many different file types not just images.

Anybody have a better way to go about this with shorter syntax? :(

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Color Filters

Post by TheQwerty »

What you're after is indeed possible but it's currently an undocumented feature (mostly because it's difficult to explain clearly).

First, notice that the help files show you how to define comments for a filter:

Code: Select all

+ageM: d AND *.txt //text files modified today>,FFFF00
Well there is a special switch ('m|') that can be placed at the start of the comment to enable "Merging" of separate background and text filters. You apply this switch to a background filter and it tells XY to continue searching for a matching filter for the text color.

What this really means is two things:
1. You have to define the background filters before (above) the text filters.
2. You have to include a comment on the background filters which beings with 'm|'.

So you were close on your first attempt! To get it working you need the following:

Code: Select all

+ageM: 0 d //m|>,FFFF00
+*.png;*.jpg;*.gif;*.tif;*.tiff;*.bmp;*.ppt;*.jpeg;*.sid;*.ecw;*.jp2;*.psd>EA0000,
Note that you can combine the switch with the comments so the following is also valid:

Code: Select all

+ageM: 0 d //m|Modified Today (with Merging)>,FFFF00
+*.png;*.jpg;*.gif;*.tif;*.tiff;*.bmp;*.ppt;*.jpeg;*.sid;*.ecw;*.jp2;*.psd>EA0000,
For full details you can read this thread (don't worry it's not long): http://www.xyplorer.com/xyfc/viewtopic. ... 974#p54974

Hope that helps! :D


EDIT: To clarify, the switch is actually just 'm'. The '|' specifies the end of switches/beginning of comments. However, since there are currently no other publicly known switches, it's just as easy (though no more correct) to refer to 'm|' as the switch. :wink:

Meester
Posts: 24
Joined: 18 Jun 2010 23:18

Re: Color Filters

Post by Meester »

Thank you very much. I really didn't think there was going to be an answer for this. The topic that you sent me too was great although I think you explained it better. The funny thing is that I was doing the rainbow thing that they talked about. Although not that extreme. The work around does seem a little strange but if it works, who cares.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Color Filters

Post by TheQwerty »

Meester wrote:The topic that you sent me too was great although I think you explained it better.
Yeah, that thread is a little hard to follow. It was originally just to open dialog about the date patterns Don was introducing but then I wished for this "merging" feature and now it's a few different discussions intertwined.
Meester wrote:The funny thing is that I was doing the rainbow thing that they talked about. Although not that extreme. The work around does seem a little strange but if it works, who cares.
That's actually my rainbow pattern, though it's been tweaked a little more to subdue the colors a bit:

Code: Select all

+ageM:<5 n //m|>,408040
+ageM:<10 n //m|>,40A040
+ageM:<15 n //m|>,60A060
+ageM:<30 n //m|>,80A080
+ageM:<45 n //m|>,60C060
+ageM:<2 h //m|>,80C080
+ageM:<6 h //m|>,A0C0A0
+ageM:<8 h //m|>,80E080
+ageM:<1 d //m|>,A0E0A0
+ageM:<5 d //m|>,A0FFA0
+ageM:<7 d //m|>,C0FFC0
+desktop.ico;desktop.ini;Thumbs.db>FFAAAA,
+attr:system>FF3333,
+*.dsw;*.sln>554400,
+*.csproj;*.dsp>006655,
+*.pdb;*.plg;*.lib;*.ncb;*.opt;*.scc;*.suo;*.tlb>666666,
+*.class;*.o;*.pyc>67B8D8,
+*.ahk;*.c;*.cpp;*.cs;*.h;*.java;*.js;*.pm;*.plx;*.pl;*.py;*.pyw;*.rb;*.rbw;*.xys>004261,
+*.htm;*.html>114400,
+*.xsl>710052,
*.xml>007152,
+*.ini;*.properties>884400,
+/hidden;*.bak>777777,
Unfortunately, I still haven't found a replacement color for *.xml that isn't lost in the freshness coloring. :|

And honestly I don't need quite so many levels; I should really do some pruning... :oops:

Meester
Posts: 24
Joined: 18 Jun 2010 23:18

Re: Color Filters

Post by Meester »

You are doing exactly what I was trying to do and, by the way, it works great. The only difference is that I only have three levels; 5 minutes, 2 hours, and 2 days old. I may add another level of a week but I'm not sure how usefull that will be as of yet. I'm a CAD guy, so my files are more AutoCAD drawing files types vs your programming files. Other than that it's the same exact idea. Like you I may have to tweak a color but since I only had three levels I was able to keep the background colors light shades.

Again thank you :!:

Man I love these forums :D

Meester
Posts: 24
Joined: 18 Jun 2010 23:18

Re: Color Filters

Post by Meester »

One thing is not working correct. There are certain files I never want to see the age of, So I put them first in the query but if they fit the age qualification then that age query takes precedence even though the File type query came first. See screen shots. The file was less that two hours old so it fit the age background color filter.

I have found that I can add a background color to the file type query and it will take precedence, but I don't want that since my background will change colors depending on what column is being sorted so I would like to leave the background color alone. Any idea's? :?
Attachments
Color Filters.jpg
Color Filters.jpg (82.92 KiB) Viewed 2551 times
Color Filters Prob.jpg
Color Filters Prob.jpg (92.71 KiB) Viewed 2551 times

admin
Site Admin
Posts: 65246
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Color Filters

Post by admin »

Meester wrote:One thing is not working correct. There are certain files I never want to see the age of, So I put them first in the query but if they fit the age qualification then that age query takes precedence even though the File type query came first. See screen shots. The file was less that two hours old so it fit the age background color filter.

I have found that I can add a background color to the file type query and it will take precedence, but I don't want that since my background will change colors depending on what column is being sorted so I would like to leave the background color alone. Any idea's? :?
Okay, in the next version you find another undocumented switch "n" (for "nomore"). Attach it to your *.bak filter and it will stay grey no matter what other filters might match later on.

Code: Select all

*.bak //n|

Meester
Posts: 24
Joined: 18 Jun 2010 23:18

Re: Color Filters

Post by Meester »

Wow, Thank you!! :D

Post Reply