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

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 »

Horst.Epp,
Yes, ADS is also a good approach if you don't already have a list of files that you want colored.

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
Mjolnir
Member
Member
Posts: 132
Joined: 2005-10-08, 21:03 UTC

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

Post by *Mjolnir »

May help (this is not based on a text file), here my "TC trick".

As I don't want any TC .ini edit, I have a quick approach with 2 TC buttons only, by create:
- a file/folder pattern search (and save it),
- and then assign colors to it
(then, it's quite easy to edit/add/remove patterns by re-click on 1st button, and load & save the search patterns again)

Note that this may have already been explained in another thread, sorry...

My buttons & example of results: Image: https://ibb.co/9pQh5Ny

My 2 TC (quick) buttons are:

Code: Select all

TOTALCMD#BAR#DATA
LOADSEARCH
-
wcmicons.dll,25
1. LoadSearch Pattern + Save


-1

Code: Select all

TOTALCMD#BAR#DATA
cm_ColorConfig

wcmicons.dll,24
2. Add Color and Assign to a Search + Confirm


494
And buttons acts as/usage is:
  • 1st button to create/select my patterns (files, folders) & save it
    • Search for (for example): *.exe;*.com;*.bat;*.sh;*.au3
    • Search in: <remove the field content!>
    • Tab "Load/Save" => Save as name, (for example): "ColorForRun"
  • 2nd button to assign a color to this saved pattern...
    • Define colors by file type
    • Add...
    • Select in the list of predefined selection type: "ColorForRun"
    • OK
    • Select a color / OK / OK
@Modo: if this is not in expected discussion, fill free to move this in the correct one...
Last edited by Mjolnir on 2022-01-12, 20:32 UTC, edited 3 times in total.
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
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'm missing an internal command to toggle file coloring on/off.
Any tips for doing this with a button ?
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
Mjolnir
Member
Member
Posts: 132
Joined: 2005-10-08, 21:03 UTC

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

Post by *Mjolnir »

@Horst.Epp
At worst, if using my method, you could use the 2nd button ("cm_ColorConfig" command), and uncheck the tickbox next to the [Define colors by file type...] button ?
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
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 »

Mjolnir wrote: 2022-01-12, 13:07 UTC @Horst.Epp
At worst, if using my method, you could use the 2nd button ("cm_ColorConfig" command), and uncheck the tickbox next to the [Define colors by file type...] button ?
I could also make a Autohotkey script to do it automatically
but thats not what I'm searching for.
I can also redirect the [Colors] section of the ini file.
Time to make a suggestion if no one has a better solution.
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
Mjolnir
Member
Member
Posts: 132
Joined: 2005-10-08, 21:03 UTC

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

Post by *Mjolnir »

Hum, not telling my method is the correct one, but if you directly edit the .ini files, any modificaiton will not be taken in live by TC, right ?
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
petermad
Power Member
Power Member
Posts: 14741
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 »

Mjolnir wrote: 2022-01-12, 13:34 UTC Hum, not telling my method is the correct one, but if you directly edit the .ini files, any modificaiton will not be taken in live by TC, right ?
I don't see that anybody has suggested to edit the .ini files on the fly. I only showed editing of the ini file to SET UP the filter, just because it it easier to show ini file content, than it is to show screenshots or long explanations of how to do it via the GUI.
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
Mjolnir
Member
Member
Posts: 132
Joined: 2005-10-08, 21:03 UTC

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

Post by *Mjolnir »

@petermad
Exact, my bad, have read too fast this thread.
Fact that I have a more ready-to-use usage (GUI) makes me confused regarding to directly editing the .ini files (that may be less understandable to common users).
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
petermad
Power Member
Power Member
Posts: 14741
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 »

Mjolnir wrote: 2022-01-12, 20:37 UTC Fact that I have a more ready-to-use usage (GUI) makes me confused regarding to directly editing the .ini files (that may be less understandable to common users).
Well, here is a mockup of how to do what I suggested - via the GUI: https://madsenworld.dk/tcmd/changefilecolorbutton.png
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: 1804
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 »

Horst.Epp wrote: 2022-01-12, 13:04 UTC I'm missing an internal command to toggle file coloring on/off.
Any tips for doing this with a button ?
This is more a trick to force coloration than to uncheck the color by file type...
Principle: if a file c:\temp\colorize.txt exists coloration is set to a standard color and this supersede other definitions !

To do it with a button is
A) create a toogle scipt. and assign it to any button or hotkey !

Code: Select all

@echo off
if exist "C:\temp\colorize.txt" (
    del /y "C:\temp\colorize.txt"
) else (
    echo NO COLOR > "C:\temp\colorize.txt"
)
B) install and or Configure Winscript Adv create a colorize.vbs script in scripts folder

Code: Select all

Set fso = CreateObject("Scripting.FileSystemObject")
content = fso.FileExists( "c:\temp\colorize.txt" )
add in options.ini

Code: Select all

[Colorize]
Script=colorize.vbs
content=colorize
extensions=*
FoldersPaths=1
Enable the script in the options.in variable ActiveScripts adding |Colorize

restart TC

C) Then use color by file type and define a search expression using plugins WinScriptAdv colorize = True to (colorize-stopper)
Then set the color to the standard color.
move using drag 'n drop the first color expression...

--> You could also make a suggestion to Christian for a new command ;)
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 »

2nsp
Thanks for the tip.
I will try it and also make a suggestion.
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
nsp
Power Member
Power Member
Posts: 1804
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 »

Horst.Epp wrote: 2022-01-13, 14:41 UTC 2nsp
Thanks for the tip.
I forgot to tell that trick do not works inside archive as the script is not called..
best would be a cm_toggleColorizeByType command.
Post Reply