Empty folder that changes color

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Empty folder that changes color

Post by *Alexisback »

Hello everyone,

what I would like to achieve and this
if the folder contains the text x265 it must turn green, and so far I have succeeded

Image: https://www.upload.ee/image/13190080/sshot-1.png

but if the folder contains the text x265 and is empty it must not be colored green but light gray

I tried but without succes :idea:
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Empty folder that changes color

Post by *petermad »

If you install the DirSizeCalc plugin ( https://totalcmd.net/plugring/dirsizecalc.html ) then these settings in wincmd.ini should do it:

Code: Select all

[Searches]
x265_SearchFor=x265
x265_SearchIn=
x265_SearchText=
x265_SearchFlags=0|002002010021|||||||||0000|||
x265_plugin=dirsizecalc.Empty = Yes

[Colors]
ColorFilter1=>x265
ColorFilter1Color=12632256
ColorFilter2=x265
ColorFilter2Color=51712
Remember to restart TC after making changes to wincmd.ini


You can also use the plugin FileX ( https://totalcmd.net/plugring/FileX.html ) it can also detect empty dirs (and it is much slimmer than DirSizeCalc):

Code: Select all

[Searches]
x265_SearchFor=x265
x265_SearchIn=
x265_SearchText=
x265_SearchFlags=0|002002010021|||||||||0000|||
x265_plugin=filex.EmptyDir = 1
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Empty folder that changes color

Post by *Alexisback »

Thank you so much petermad :D
works great with DirSizeCalc :wink:
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Empty folder that changes color

Post by *Alexisback »

something does not work, :roll:

1) if it is empty and has the name x265 it is colored light gray

Image: https://www.upload.ee/image/13191808/sshot-1.png

2) if the folder has content and only the name x265 is colored green

Image: https://www.upload.ee/image/13191810/sshot-2.png

3) but if I add some content and other text to x265 it returns to default color

example:
X265 with content and other text in the title

Image: https://www.upload.ee/image/13191814/sshot-3.png
Last edited by Alexisback on 2021-05-31, 10:39 UTC, edited 1 time in total.
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Empty folder that changes color

Post by *nsp »

Can you validate your x265 search expression to see if it match all 3 folder ?
if not you could change to *x265* and save your search expression again !
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Empty folder that changes color

Post by *Alexisback »

nsp wrote: 2021-05-31, 08:10 UTC Can you validate your x265 search expression to see if it match all 3 folder ?
if not you could change to *x265* and save your search expression again !
some examples? :roll:
i used petermad code
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Empty folder that changes color

Post by *petermad »

2Alexisback
Try and change

Code: Select all

x265_SearchFor=x265
ColorFilter2=x265
to

Code: Select all

x265_SearchFor=x265.
ColorFilter2=x265.
with a period after x265.

But if you also want to be sure that no files with the name x265 are colored, then the whole thing should be changed to:

Code: Select all

[Searches]
x265notempty_SearchFor=x265.
x265notempty_SearchIn=
x265notempty_SearchText=
x265notempty_SearchFlags=0|002002010021||||||||22221|0000|||
x265empty_SearchFor=x265.
x265empty_SearchIn=
x265empty_SearchText=
x265empty_SearchFlags=0|002002010021||||||||22221|0000|||
x265empty_plugin=dirsizecalc.Empty = Yes

[Colors]
ColorFilter1=>x265empty
ColorFilter1Color=12632256
ColorFilter2=>x265notempty
ColorFilter2Color=51712
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Empty folder that changes color

Post by *Alexisback »

Alexisback wrote: 2021-05-31, 07:47 UTC something does not work, :roll:

1) if it is empty and has the name x265 it is colored light gray

Image: https://www.upload.ee/image/13191808/sshot-1.png

2 ) if the folder has content and only the name x265 is colored green

Image: https://www.upload.ee/image/13191810/sshot-2.png

3 )but if I add some content and other text to x265 it returns to default color

example:
X265 with content and other text in the title

Image: https://www.upload.ee/image/13191814/sshot-3.png
maybe I explained myself wrong

point 3 with the title x265 in the folder should be colored green,

Code: Select all

[Searches]
x265_SearchFor=x265.
x265_SearchIn=
x265_SearchText=
x265_SearchFlags=0|002002010021|||||||||0000|||
x265_plugin=dirsizecalc.Empty = Yes

Code: Select all

[Colors]
ColorFilter1=>x265
ColorFilter1Color=12632256
ColorFilter2=x265.
ColorFilter2Color=51712
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Empty folder that changes color

Post by *petermad »

2Alexisback
OK - I think I got your demands backwards - try this in stead:

Code: Select all

[Searches]
x265notempty_SearchFor=x265
x265notempty_SearchIn=
x265notempty_SearchText=
x265notempty_SearchFlags=0|002002010021||||||||22221|0000|||
x265empty_SearchFor=x265
x265empty_SearchIn=
x265empty_SearchText=
x265empty_SearchFlags=0|002002010021||||||||22221|0000|||
x265empty_plugin=dirsizecalc.Empty = Yes

[Colors]
ColorFilter1=>x265empty
ColorFilter1Color=12632256
ColorFilter2=>x265notempty
ColorFilter2Color=51712
This should use green if a folder name contains x265 and the folder is empty, and grey if a folder name contains x265 and the folder is not empty
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Empty folder that changes color

Post by *Alexisback »

perfect, it works :mrgreen:
now it is displayed as I wanted

Thank you very much petermad :wink:
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Empty folder that changes color

Post by *Alexisback »

I would like to make a small change,
the folder should turn green only if there is a video with .mp4 or mkv extension and the word x265 in the title
otherwise it should be light gray
it's possible? :roll:
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Empty folder that changes color

Post by *petermad »

2Alexisback
the folder should turn green only if there is a video with .mp4 or mkv extension and the word x265 in the title
I cannot think of a way to do that - sorry
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply