Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

English support forum

Moderators: white, Hacker, petermad, Stefan2

9kvD38n6
Junior Member
Junior Member
Posts: 89
Joined: 2010-09-03, 08:23 UTC

Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *9kvD38n6 »

I would like to create a color filter to highlight specific folders or files that I want to stand out in the file list of certain parent folders that have many entries. Say there are 200 text files in Folder C:\Test\ and I usually want to select and view the file ViewMe.txt in that folder. So I would like its name to be drawn in pink, for example, so that I can spot it quickly. And likewise for maybe another 100+ files or folders all across my file system.

What I am currently doing is simply to rename such files and append a trailing underscore to the filename, e. g. as ViewMe_.txt. I have a global color filter for such files and folders and it works great, just the way I want it to, with hardly any false positives. The only problem is that this messes with backups. Every time I "add" a file to this color filter group by renaming it, the backup software might not back it up anymore because the file name has changed. Or if it is a folder name, it will be copied to the target backup folder a second time, which might cause problems if it's a large folder etc.

To cut a long story short, I'd like to use a script triggered via a hotkey (something TC-internal or Autohotkey) to simply add the paths of the files and folders I want highlighted to a .txt file somewhere when I have them selected in the file list. So navigate to ViewMeToo.txt, press hotkey, Path is added to .txt file. For this modus operandi to work, I would need to tell TC to color the name of any file or folder found in that list according to the color setting for that filter when it shows up in the file list.

Is there currently a way to do this? If not, I'd like this to be a feature request, please.

Maybe someone else is using a less "invasive" method than changing the file name with good success for similar purposes? Maybe I could base it on file descriptions instead?

PS: Imge illustrating my trailing underscore method below, it sets the color for files or folders to white...

Thank you!

Image: https://imgur.com/a/9ZMrP83
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *petermad »

29kvD38n6
Maybe this can help you: viewtopic.php?p=354857#p354857 When set up as described you just navigate to the file, press Crtl+Z, write for color=orange and press F2.

It can even be automated to a button with the OPENATTRIBUTES= parameter
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
9kvD38n6
Junior Member
Junior Member
Posts: 89
Joined: 2010-09-03, 08:23 UTC

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *9kvD38n6 »

That looks very promising. I'll give it a go!
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *petermad »

29kvD38n6

The recipe to mark any folder or file to be colored by using the File Comment function:

Put this in the [Searches] section of your windmd.ini file:

Code: Select all

Color orange_SearchFor=
Color orange_SearchIn=
Color orange_SearchText=
Color orange_SearchFlags=0|002002010021|||||||||0000|||
Color orange_plugin=tc.comment contains color=orange
And this in the [Colors] section:

Code: Select all

ColorFilter1=>Color orange
ColorFilter1Color=33023
(change 1 if you already have color filters)


And this in the [attrplugin] section of your wincmd.ini file:

Code: Select all

ColorOrange=tc.comment := "[=tc.comment] color=orange"
ColorNone=tc.comment := ""

Then you can use this button to set the color for one or more selected files:

Code: Select all

TOTALCMD#BAR#DATA
OPENATTRIBUTES =ColorOrange

wcmicons.dll,39
Orange filename color


-1
And this button to remove the color again:

Code: Select all

TOTALCMD#BAR#DATA
OPENATTRIBUTES =ColorNone

wcmicons.dll,40
No filename color


-1
To make the buttons:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".

08-01-2022, 23:46 EDITED the [attrplugin] here above.
Notice the first buttons ADDS color=orange to the description of the file. The second button removes the entire description - so con't use it on files with descriptions you want to keep.
Last edited by petermad on 2022-01-08, 22:54 UTC, edited 6 times in total.
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
9kvD38n6
Junior Member
Junior Member
Posts: 89
Joined: 2010-09-03, 08:23 UTC

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *9kvD38n6 »

Hey man, amazing! Thank you so much for taking the time to explain in detail!

I've got all set up now, color changed to white for my needs and set to a hotkey via UserCmd.ini rather than a button. Just what I wanted.

You da man!!
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *petermad »

29kvD38n6

Notice that I made a change to the [attrplugin] section so the color= is ADDED to the description, if there already is one.
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
9kvD38n6
Junior Member
Junior Member
Posts: 89
Joined: 2010-09-03, 08:23 UTC

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *9kvD38n6 »

Right, adopted that as well, cheers!
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *Horst.Epp »

There is a small problem with removing the color.
It also removes any other comment which was preserved while adding the color.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *petermad »

2Horst.Epp

That's why I wrote:
petermad wrote: The second button removes the entire description - so con't use it on files with descriptions you want to keep.
I don't see anyway to avoid that.

I could make button two set the color to black (or whatever the user uses as default), and then prioritize colorBlack higher than colorOrange, but then it would never be possible to set it to orange again without editing the description file manually.
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
9kvD38n6
Junior Member
Junior Member
Posts: 89
Joined: 2010-09-03, 08:23 UTC

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *9kvD38n6 »

Guess you'd have to use an external script to remove just that line from the .ion file if you use file descriptions for other purposes (which I don't). Still a very happy camper here.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *Horst.Epp »

Its still a fine solution.
I will make my version which uses the NTFS_DIZ plugin adding an ADS comment.
This will allow to color file names but in addition I have indexed that ADS stream in Everything.
So I can find all files with such an attribute in seconds.
This attribute also survives copying a file outside of TC with XYplorer or Windows Explorer.
Its bound to NTFS of course but all volumes I have including USB are NTFS formatted.
Last edited by Horst.Epp on 2022-01-09, 18:09 UTC, edited 1 time in total.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *petermad »

Horst.Epp wrote: 2022-01-09, 12:46 UTC I will make my version which uses the NTFS_DIZ plugin adding an ADS tag.
Smart idea.
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
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *nsp »

If you are a programmer, you could make a simple personal wdx plugin (script, or anything ) that read your list file and compare with requested file to return a color or whatever.

Then use search expressions using your plugin to colorize.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *Hacker »

nsp,
That's a great idea. Using [wdx] WinScript Advanced Content Plugin (x86\x64) (new) this should be a matter of minutes, if anyone needs such functionality.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Define colors by file type: Add file or folder names on the fly ('favorites' based on list in .txt file?)

Post by *Horst.Epp »

I use the coloring like bookmarks.
Using the NTFS_diz plugin adding ADS streams has the benefit of indexing with Everything
and survives operations with other file managers and Explorer.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Post Reply