TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

:arrow: see my previous post for analysis of your (@Horst.Epp) debug dump


For example here my main TC ?ini file "TC_forRedirection.ini":
...

[Colors]
RedirectSection=0
ColorFilter1=>PatternColorDummy
ColorFilter1Color=33023
; 33023 = Orange

[searches]
RedirectSection=1
PatternColorDummy_SearchFor=*.PatternColorDummy;*.dat
PatternColorDummy_SearchIn=
PatternColorDummy_SearchText=
PatternColorDummy_SearchFlags=0|002002000020|||||||||0000|||

[Configuration]
; AlternateUserIni=
AlternateUserIni=c:\Temp\TC_Light_wincmd_Redirection4.ini

...
And the "TC_Light_wincmd_Redirection4.ini" redirected .ini file :
...
[Colors]
ColorFilter1=>PatternColorDummy
ColorFilter1Color=255
[searches]
PatternColorDummy_SearchFor=*.PatternColorDummy;*.ini
PatternColorDummy_SearchIn=
PatternColorDummy_SearchText=
PatternColorDummy_SearchFlags=0|002002000020|||||||||0000|||
...
In those examples the [Colors] section is taken from main .ini file (due to RedirectSection=0) and the [searches] from the redirected one (due to RedirectSection=1)
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: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Horst.Epp »

Mjolnir wrote: 2023-01-05, 17:11 UTC Yes, thx you !

Haaaaa, found some points:
1. You may have too many declared lines with possibly same "=>PatternColorDummy" value in [Colors] section (but this not the main point (even if there may be a pb regarding "which declared color is taken first on duplicated values"; I need to check this on my side))

2. There is no "AlternateUserIni=" filled variable, (only ?) expected it in the main [Configuration] section, for .ini redirection => see help extract below
- the "RedirectSection" parameter format (should be only 1 or 0 ?)
- & missing the "AlternateUserIni" (should be in [Configuration] section ?)
If you read the help completely you will find what most users do !
You just ignore thge lsat line of this help section.

The full help says:

2. All sections can be redirected individually:
In each section, an entry
RedirectSection=
can be added to change the default behaviour. It will allow to redirect (or not) this section to another ini file:
Possible values:
0: no redirect even if the section would be redirected by AlternateUserIni
1: redirect to ini file defined via AlternateUserIni=<alternate ini file.ini>
<ininame.ini>: redirect to that specific ini

AlternateUserIni setting is not needed at all !
Read the help more carefully as it says:

1. Global option in section [Configuration]:
AlternateUserIni=<somename.ini>
If present in section [Configuration], it will redirect storing of all user-changeable sections to an alternate ini file (in this example, somename.ini), except for the following sections: [Configuration], [Layout], [Packer], [Confirmation], [Extensions], [Associations], [Shortcuts], [ShortcutsWin], [PackerPlugins], [FileSystemPlugins], [ListerPlugins], [ContentPlugins].
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

Okayyy, was not that clear for me, as said, I don't use this feature, so only dive into it this afternoon :oops:
I've understood the "All sections can be redirected individually:" + "RedirectSection=0|1" but takes appart the last "<ininame.ini>: redirect to that specific ini", thinking that was the .ini file referenced by the "AleternateUserIni=" variable in [Configuration] section.
I'll test this point later.
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

OK, I'm more confident now with Redirections, here a quite good rework regarding it (+ a better debug dump content)... keep me in touch!

Version 2023.1.6.1 32/64
URL: TC_PatternColor_2023.1.6.1 (use the upper right download arrow/button) // md5: bc4f9f91bcac9dcb8ae11ab470469aad *TC_PatternColor.exe

Features
+ Huge improvement regarding "Redirections" ([Colors] & [searches] sections)
+ Debug dump improved (if set DEBUG=1)
+ Modified 1 parameter:
-- TCIniFileBkpBeforeModif=0 => Backup of .ini files set to *NO* by default (can change it to =1 to perform backup again, of *ALL* possible .ini files (like "redirection" ones too))
+ Added 2 new parameters in .ini :
-- TCIniFileBkpBeforeModifWarnOnBkpError=0 => (only active if TCIniFileBkpBeforeModif=1): if set to 1 and an error occurs during copy => warn user
-- TCKeyAddSearchInAndText=0 => to NOT add extra keys "PatternColorXxx_SearchIn=" & "PatternColorXxx_SearchText="
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: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Horst.Epp »

This gives the error message
---------------------------
Information (2023.1.6.1)
---------------------------
WARNING: _CheckIniFileIfRedirection()
- Section = [searches]
- RedirectSection = [associations-searches.ini]

File: [associations-searches.ini]
=> does not exists, please check...
---------------------------
OK
---------------------------

But the file associations-searches.ini exists.
Its in the same dir as wincmd.ini.
This is a portable installation, so the files without a path are searched by TC in its home dir.

Here the debug log:

Code: Select all

-------(1/0/0.2ms)-------
=== Main: Read configs & Cmd Line params ===

-------(1/0/0.47ms)-------
$rev = [2023.1.6.1]
@ScriptFullPath = [C:\Tools\Wincmd\PLUGINS\TC_PatternColor\TC_PatternColor.exe]

-------(1/0/1.41ms)-------
Call: _SC_GetIniConf()
- $CfgIniFile = C:\Tools\Wincmd\PLUGINS\TC_PatternColor\TC_PatternColor.ini
-------
- $TCExe		[C:\Tools\Wincmd\totalcmd64.exe]
- $TCParams	[/N /I=]
- $TCIniFile	[C:\Tools\Wincmd\wincmd.ini]
-------
- _GetPath($TCExe)	[C:\Tools\Wincmd\]

-------(1/432/1.76ms)-------
   Check: [Colors] section Redirection ?:
     Call: _CheckIniFileIfRedirection(Colors,C:\Tools\Wincmd\wincmd.ini):
     - TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
     - AlternateUserIni: []
     - TCIniFile_Redirection (section): [none] (if 3 => does not exists)
   => Process with: [C:\Tools\Wincmd\wincmd.ini]

-------(1/432/2.1ms)-------
   Check: [searches] section Redirection ?:
     Call: _CheckIniFileIfRedirection(searches,C:\Tools\Wincmd\wincmd.ini):
     - TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
     - AlternateUserIni: []
     - TCIniFile_Redirection (section): [associations-searches.ini] (if 3 => does not exists)
   => Process with: [associations-searches.ini]

-------(1/433/2.25ms)-------
WARNING: _CheckIniFileIfRedirection()
- Section = [searches]
- RedirectSection = [associations-searches.ini]
- File [associations-searches.ini] does not exists, please check...
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

Argh, sorry...

Here a new version:

Version 2023.1.6.2 32/64
URL: TC_PatternColor_2023.1.6.2 (use the upper right download arrow/button) // 69f1784369a1b3c5bb5e1716c252068b *TC_PatternColor.exe

Features
+ Do NOT handle duplicate values (ex: Selected Dummy.xyz and FileName.xyz => got same <ext> => if 1st already processed, do not process next same ones)
+ Handle Redirection .ini file check, in this order: search & check 1st localy (~script folder), then in "given" TC .ini path, then in TC .exe path (COMMANDER_PATH)
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: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Horst.Epp »

Some improvement :)

There are no error messages on startup and I can create the button.
But invoking the button doesn't work, it just restarts TC.
No color selection box as in the first versions.

The button is this:

Code: Select all

TOTALCMD#BAR#DATA
C:\Tools\Wincmd\PLUGINS\TC_PatternColor\TC_PatternColor.exe
/E PatternColorDummy %S
wcmicons.dll,44
Set/Unset: PatternColorDummy


-1
The redirected Search section now has:
PatternColorDummy_SearchFor=*.PatternColorDummy;*.txt;*.ini;*.ion;*.vbs;*.ods
PatternColorDummy_SearchFlags=0|002002000020|||||||||0000|||

The Colors section of Wincmd.ini now has the following entries:
ColorFilter9=>PatternColorDummy
ColorFilter9Color=255

After the TC restart non of the selected files have changed their color.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

:(
OK... on a button click, on a selected file, data is written in dedicated sections, cool.

You'll not get any "color selection" box ("as in the first versions"), as the color "PatternColorDummy" has already been defined/created.
If you want another color => need to duplicate the button, and change the "PatternColorDummy" to something like (in my side): "PatternColorRed" or "PatternColorGreen"... (that's why I have as many button as color assignation I want)

I'm missing some details now to investigate:
- Have you any other colors for any files in TC panels ?
- Can you create a button & activated/deactivated the "cm_SwitchColorsByFileType" switch option ?
- Can you check in Menu:Configuration/Color => button "Define colors by file type..." if you see the "PatternColorDummy" information ?
- Eventually
-- create manually color by file type filer using the menu & compare the created lines with "PatternColorDummy" ones
-- check having no other "ColorFilterXX=>PatternColorDummy" targetted to a "ColorFilterXXColor=<Black or White>" color ?
- Finally, send me a "DEBUG=1" clipboard content...

As already said, thank you for your (debug) help and time !
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

And, I understand now your point "No color selection box as in the first versions", this makes me think of another way to select colors...

Actually: I've implemented my app to have -one button for one color assignation- (ie, have as many button as color to assign), this exactly to avoid the raise of the color picker box (ie, "outside TC") each time I press the button.

But, I may have created a "one only button" to assign color, by choosing it in the color picker box... well, let me think about this...
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: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Horst.Epp »

By default I have defined colors by file type.
I have a button for cm_SwitchColorsByFileType and switched it off for testing.
The Define colors by file type dialog shows the >PatternColorDummy entry.

The Debug output for running the default button:

Code: Select all

-------(1/0/0.23ms)-------
=== Main: Read configs & Cmd Line params ===

-------(1/0/0.35ms)-------
$rev = [2023.1.6.2]
@ScriptFullPath = [C:\Tools\Wincmd\PLUGINS\TC_PatternColor\TC_PatternColor.exe]

-------(1/0/1.43ms)-------
Call: _SC_GetIniConf()
- $CfgIniFile = C:\Tools\Wincmd\PLUGINS\TC_PatternColor\TC_PatternColor.ini
-------
- $TCExe		[C:\Tools\Wincmd\totalcmd64.exe]
- $TCParams	[/N /I=]
- $TCIniFile	[C:\Tools\Wincmd\wincmd.ini]
-------
- _GetPath($TCExe)	[C:\Tools\Wincmd\]

-------(1/432/1.77ms)-------
   Check: [Colors] section Redirection ?:
     Call: _CheckIniFileIfRedirection(Colors,C:\Tools\Wincmd\wincmd.ini):
     - TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
     - AlternateUserIni: []
     - TCIniFile_Redirection (section): [none] (if 3 => does not exists)
   => Process with: [C:\Tools\Wincmd\wincmd.ini]

-------(1/432/2.12ms)-------
   Check: [searches] section Redirection ?:
     Call: _CheckIniFileIfRedirection(searches,C:\Tools\Wincmd\wincmd.ini):
     - TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
     - AlternateUserIni: []
     - TCIniFile_Redirection (section): [associations-searches.ini] (if 3 => does not exists)
   => Process with: [associations-searches.ini]

-------(1/0/5.66ms)-------
=== Dump Debug ini Var sections (BEGIN) ===
+ Dump TC Ini File= [C:\Tools\Wincmd\wincmd.ini]
  Section [Configuration]
    - AlternateUserIni = 
  Section [Colors]
    - InverseCursor = [0]
    - BackColor = [-1]
    - ForeColor = [-1]
    - MarkColor = [-1]
    - CursorColor = [16711680]
    - CursorText = [-1]
    - CompareText = [16711680]
    - CompareTextSel = [16711680]
    - ActiveTabColor = [128]
    - ActiveTitle = [37888]
    - ActiveTitleText = [16777215]
    - ColorFilter1 = [>Autorun]
    - ColorFilter1Color = [0]
    - ColorFilter8 = [>Color Image]
    - ColorFilter8Color = [8421440]
    - InverseSelection = [0]
    - BackColor2 = [-1]
    - ColorFilter2 = [>TwinKey Startup]
    - ColorFilter2Color = [0]
    - ColorFilter3 = [>Documents]
    - ColorFilter3Color = [3368448]
    - ColorFilter4 = [>Color blue]
    - ColorFilter4Color = [33023]
    - ColorFilter5 = [>Color Video]
    - ColorFilter5Color = [33023]
    - ColorFilter6 = [>Color Compressed]
    - ColorFilter6Color = [32768]
    - ColorFilter7 = [>Color Executable]
    - ColorFilter7Color = [16481536]
    - ThemedCursor = [1]
    - ColorFilter3ColorDark = [16750899,3368448]
    - ColorFilter4ColorDark = [16776960,33023]
    - ColorFilter7ColorDark = [60652,16481536]
    - ColorFilter5ColorDark = [8830969,33023]
    - ColorFilter8ColorDark = [32251,8421440]
    - ColorFilter9 = [>PatternColorDummy]
    - ColorFilter9Color = [255]
  Section [searches]
    - RedirectSection = [associations-searches.ini]
-------
+ Optional: Dump TC AlternateUserIni for File= []

-------(1/5/5.78ms)-------
Call: _SC_GetCommandLineParameters()

-------(1/50/6.08ms)-------
Param: /E|/N 3 = [clean.ini]
Cumulated to process = [clean.ini|]

-------(1/50/6.46ms)-------
Param: /E|/N 4 = [00_index.001.txt]
Cumulated to process = [clean.ini|00_index.001.txt|]

-------(1/50/6.76ms)-------
Param: /E|/N 5 = [Test.cmd]
Cumulated to process = [clean.ini|00_index.001.txt|Test.cmd|]

-------(1/51/7.04ms)-------
(5) - Param #1 = /E
- TCKeyValueHandleAsExt = [1]
- TCColorKey (Param #2) = [PatternColorDummy]
- TCColorKeyListValuesToAdd (Param #3+) = [clean.ini|00_index.001.txt|Test.cmd|]

-------(1/53/7.39ms)-------
_SC_GetCommandLineParameters()
- Color = [PatternColorDummy]
- TCColorKeyListValuesToAdd [clean.ini|00_index.001.txt|Test.cmd] (to parse later)

-------(1/0/7.62ms)-------
=== Main: TC pre-configs (hWnd, SaveConf, BackupIni) ===

-------(1/15/8.42ms)-------
Call: _TC_GethWnd()
- Get TC [[CLASS:TTOTAL_CMD]]
- hWnd:0x0036110A (@error = 0)

-------(1/17/8.5ms)-------
Call: _TC_SaveConf()
- Save conf TC: _WinAPI_PostMessage(0x0036110A, 1075, 580, 0)

-------(1/0/135.9ms)-------
=== Main: Process check <Color> in TC .ini [Colors] & [searches] sections ===

-------(1/6/139.98ms)-------
Call: _TC_CheckColors()
- $TCColorKey [PatternColorDummy]

-------(1/432/146.1ms)-------
   Check: [Colors] section Redirection ?:
     Call: _CheckIniFileIfRedirection(Colors,C:\Tools\Wincmd\wincmd.ini):
     - TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
     - AlternateUserIni: []
     - TCIniFile_Redirection (section): [none] (if 3 => does not exists)
   => Process with: [C:\Tools\Wincmd\wincmd.ini]

-------(1/432/149.48ms)-------
   Check: [searches] section Redirection ?:
     Call: _CheckIniFileIfRedirection(searches,C:\Tools\Wincmd\wincmd.ini):
     - TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
     - AlternateUserIni: []
     - TCIniFile_Redirection (section): [associations-searches.ini] (if 3 => does not exists)
   => Process with: [associations-searches.ini]

-------(1/0/149.83ms)-------
=== Main: Pre process TC Exit ===

-------(1/191/150.06ms)-------
Call: _TC_Exit()
- Exit TC: [C:\Tools\Wincmd\totalcmd64.exe, hWnd=0x0036110A]

-------(1/192/154.52ms)-------
Action: WinAPI message to TC:
- _WinAPI_PostMessage(0x0036110A, 1075, 24340, 0)

-------(1/193/719.51ms)-------
Action: ProcessClose():
- Close TC: [PID=12272]

-------(1/0/724.31ms)-------
=== Main: Process matching <Pattern(s)> <-> <Color> in TC .ini [searches] section ===

-------(1/432/727.09ms)-------
   Check: [searches] section Redirection ?:
     Call: _CheckIniFileIfRedirection(searches,C:\Tools\Wincmd\wincmd.ini):
     - TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
     - AlternateUserIni: []
     - TCIniFile_Redirection (section): [associations-searches.ini] (if 3 => does not exists)
   => Process with: [associations-searches.ini]

-------(1/40/727.4ms)-------
Call: _TC_CheckPatterns_AddUpdateRemove()
- $TCColorKey: [PatternColorDummy]
- $TCIniSearchSection: [searches]
- $TCIniFile_PreRedirection: [C:\Tools\Wincmd\wincmd.ini]
- $TCColorKeyListValuesToAdd: [clean.ini|00_index.001.txt|Test.cmd]
=> $TCIniFile: [C:\Tools\Wincmd\associations-searches.ini]

-------(1/40/727.54ms)-------
(#40) Process BEGIN: for[1,3] = [clean.ini] => in TCColorKey = [PatternColorDummy]

-------(1/41/728.11ms)-------
(#41) File/Folder ext (Attrib=A) : 
- TCColorKey=PatternColorDummy
- TCColorKeyValueToAdd=clean.ini
- Ext=*.ini

-------(1/42/728.57ms)-------
(#42a2) Ext found: ***To processed***
- TCColorKey=PatternColorDummy
- TCColorKeyValueToAdd=,*.ini

-------(1/20/728.83ms)-------
Call: _TC_SetPatterns_AddOrRemove(PatternColorDummy,*.ini)

-------(1/32/729.27ms)-------
Remove : ***NOT NEEDED***
- 
- *.ini

-------(1/32/729.44ms)-------
Remove : ***NOT NEEDED***
- 
- *.ini

-------(1/32/729.62ms)-------
Remove : ***NOT NEEDED***
- *.bmp *.gif *.jpg *.png *.psd *.tif *.heic *.jpeg *.webp *.apng *.tga *.arw *.wmf
- *.ini

-------(1/32/729.78ms)-------
Remove : ***NOT NEEDED***
- ^\d{0}\$
- *.ini

-------(1/32/729.95ms)-------
Remove : ***NOT NEEDED***
- *.bmp *.gif *.jpg *.png *.psd *.tif *.jpeg *.heic *.svg *.webp *.wmf *.eps *.ico *.tga *.apng *.arw
- *.ini

-------(1/32/730.12ms)-------
Remove : ***NOT NEEDED***
- *.zip *.7z *.rar *.cab *.zpaq
- *.ini

-------(1/32/730.28ms)-------
Remove : ***NOT NEEDED***
- 
- *.ini

-------(1/32/730.44ms)-------
Remove : ***NOT NEEDED***
- *.exe *.bat  *.lnk
- *.ini

-------(1/32/730.62ms)-------
Remove : ***NOT NEEDED***
- ev:ext:7z;ace;arj;bz2;cab;gz;gzip;r00;r01;r02;r03;r04;r05;r06;r07;r08;r09;r10;r11;r12;r13;r14;r15;r16;r17;r18;r19;r20;r21;r22;r23;r24;r25;r26;r27;r28;r29;rar;tar;tgz;z;zip;jar;zpaq
- *.ini

-------(1/32/730.78ms)-------
Remove : ***NOT NEEDED***
- ed:datemodified:today
- *.ini

-------(1/32/730.94ms)-------
Remove : ***NOT NEEDED***
- ed:folder: !depth:0
- *.ini

-------(1/32/731.11ms)-------
Remove : ***NOT NEEDED***
- 
- *.ini

-------(1/32/731.27ms)-------
Remove : ***NOT NEEDED***
- *.mp4 *.avi *.mov *.flv *.webm
- *.ini

-------(1/32/731.43ms)-------
Remove : ***NOT NEEDED***
- *.mp4 *.avi *.mov *webm *.flv *.mpg *.mkv *.wmv *.ogg
- *.ini

-------(1/32/731.59ms)-------
Remove : ***NOT NEEDED***
- 
- *.ini

-------(1/32/731.76ms)-------
Remove : ***NOT NEEDED***
- 
- *.ini

-------(1/32/731.92ms)-------
Remove : ***NOT NEEDED***
- *.doc;*.docx;*.xls;*.xlsx;
- *.ini

-------(1/32/732.09ms)-------
Remove : ***NOT NEEDED***
- ed: folder: childcount:0
- *.ini

-------(1/32/732.25ms)-------
Remove : ***NOT NEEDED***
- ev:
- *.ini

-------(1/32/732.41ms)-------
Remove : ***NOT NEEDED***
- 
- *.ini

-------(1/21/732.58ms)-------
Call: _TC_SetPatterns_Remove(PatternColorDummy,*.ini)

-------(1/311/732.74ms)-------
Remove : ***NEEDED***
- TCColorKeyCurrentValue = *.PatternColorDummy;*.ion;*.vbs;*.ods;*.ini;*.txt
- TCColorKeyValueToAdd = *.ini

-------(1/312/732.86ms)-------
To Remove (from):
- Ini    	C:\Tools\Wincmd\associations-searches.ini
- Section	searches
- Key    	PatternColorDummy_SearchFor
- Current	*.PatternColorDummy;*.ion;*.vbs;*.ods;*.ini;*.txt
- Remove 	;"*.ini"
- Like   	*.PatternColorDummy;*.ion;*.vbs;*.ods;*.txt

Action:
- Del: [*.ini] (TCColorKeyValueToAdd) => [PatternColorDummy] (TCColorKey)

-------(1/1/733.02ms)-------
Call: _IniWrite(): 
- IniFile	C:\Tools\Wincmd\associations-searches.ini
- IniSection	[searches]
- IniKey	PatternColorDummy_SearchFor
- IniKeyValue	=*.PatternColorDummy;*.ion;*.vbs;*.ods;*.txt

-------(1/40/733.64ms)-------
(40#0) Process END  : for[1,3] = [clean.ini] => in TCColorKey = [PatternColorDummy]

-------(1/40/733.74ms)-------
(#40) Process BEGIN: for[2,3] = [00_index.001.txt] => in TCColorKey = [PatternColorDummy]

-------(1/41/733.98ms)-------
(#41) File/Folder ext (Attrib=A) : 
- TCColorKey=PatternColorDummy
- TCColorKeyValueToAdd=00_index.001.txt
- Ext=*.txt

-------(1/42/734.12ms)-------
(#42a2) Ext found: ***To processed***
- TCColorKey=PatternColorDummy
- TCColorKeyValueToAdd=,*.txt

-------(1/20/734.3ms)-------
Call: _TC_SetPatterns_AddOrRemove(PatternColorDummy,*.txt)

-------(1/32/734.74ms)-------
Remove : ***NOT NEEDED***
- 
- *.txt

-------(1/32/734.91ms)-------
Remove : ***NOT NEEDED***
- 
- *.txt

-------(1/32/735.82ms)-------
Remove : ***NOT NEEDED***
- *.bmp *.gif *.jpg *.png *.psd *.tif *.heic *.jpeg *.webp *.apng *.tga *.arw *.wmf
- *.txt

-------(1/32/735.99ms)-------
Remove : ***NOT NEEDED***
- ^\d{0}\$
- *.txt

-------(1/32/736.17ms)-------
Remove : ***NOT NEEDED***
- *.bmp *.gif *.jpg *.png *.psd *.tif *.jpeg *.heic *.svg *.webp *.wmf *.eps *.ico *.tga *.apng *.arw
- *.txt

-------(1/32/736.33ms)-------
Remove : ***NOT NEEDED***
- *.zip *.7z *.rar *.cab *.zpaq
- *.txt

-------(1/32/736.5ms)-------
Remove : ***NOT NEEDED***
- 
- *.txt

-------(1/32/736.66ms)-------
Remove : ***NOT NEEDED***
- *.exe *.bat  *.lnk
- *.txt

-------(1/32/736.86ms)-------
Remove : ***NOT NEEDED***
- ev:ext:7z;ace;arj;bz2;cab;gz;gzip;r00;r01;r02;r03;r04;r05;r06;r07;r08;r09;r10;r11;r12;r13;r14;r15;r16;r17;r18;r19;r20;r21;r22;r23;r24;r25;r26;r27;r28;r29;rar;tar;tgz;z;zip;jar;zpaq
- *.txt

-------(1/32/737.21ms)-------
Remove : ***NOT NEEDED***
- ed:datemodified:today
- *.txt

-------(1/32/737.42ms)-------
Remove : ***NOT NEEDED***
- ed:folder: !depth:0
- *.txt

-------(1/32/737.59ms)-------
Remove : ***NOT NEEDED***
- 
- *.txt

-------(1/32/737.76ms)-------
Remove : ***NOT NEEDED***
- *.mp4 *.avi *.mov *.flv *.webm
- *.txt

-------(1/32/737.92ms)-------
Remove : ***NOT NEEDED***
- *.mp4 *.avi *.mov *webm *.flv *.mpg *.mkv *.wmv *.ogg
- *.txt

-------(1/32/738.09ms)-------
Remove : ***NOT NEEDED***
- 
- *.txt

-------(1/32/738.27ms)-------
Remove : ***NOT NEEDED***
- 
- *.txt

-------(1/32/738.43ms)-------
Remove : ***NOT NEEDED***
- *.doc;*.docx;*.xls;*.xlsx;
- *.txt

-------(1/32/738.6ms)-------
Remove : ***NOT NEEDED***
- ed: folder: childcount:0
- *.txt

-------(1/32/738.76ms)-------
Remove : ***NOT NEEDED***
- ev:
- *.txt

-------(1/32/738.93ms)-------
Remove : ***NOT NEEDED***
- 
- *.txt

-------(1/21/739.1ms)-------
Call: _TC_SetPatterns_Remove(PatternColorDummy,*.txt)

-------(1/311/739.25ms)-------
Remove : ***NEEDED***
- TCColorKeyCurrentValue = *.PatternColorDummy;*.ion;*.vbs;*.ods;*.txt
- TCColorKeyValueToAdd = *.txt

-------(1/312/739.38ms)-------
To Remove (from):
- Ini    	C:\Tools\Wincmd\associations-searches.ini
- Section	searches
- Key    	PatternColorDummy_SearchFor
- Current	*.PatternColorDummy;*.ion;*.vbs;*.ods;*.txt
- Remove 	;"*.txt"
- Like   	*.PatternColorDummy;*.ion;*.vbs;*.ods

Action:
- Del: [*.txt] (TCColorKeyValueToAdd) => [PatternColorDummy] (TCColorKey)

-------(1/1/739.5ms)-------
Call: _IniWrite(): 
- IniFile	C:\Tools\Wincmd\associations-searches.ini
- IniSection	[searches]
- IniKey	PatternColorDummy_SearchFor
- IniKeyValue	=*.PatternColorDummy;*.ion;*.vbs;*.ods

-------(1/40/740.09ms)-------
(40#0) Process END  : for[2,3] = [00_index.001.txt] => in TCColorKey = [PatternColorDummy]

-------(1/40/740.18ms)-------
(#40) Process BEGIN: for[3,3] = [Test.cmd] => in TCColorKey = [PatternColorDummy]

-------(1/41/740.43ms)-------
(#41) File/Folder ext (Attrib=A) : 
- TCColorKey=PatternColorDummy
- TCColorKeyValueToAdd=Test.cmd
- Ext=*.cmd

-------(1/42/740.55ms)-------
(#42a2) Ext found: ***To processed***
- TCColorKey=PatternColorDummy
- TCColorKeyValueToAdd=,*.cmd

-------(1/20/740.76ms)-------
Call: _TC_SetPatterns_AddOrRemove(PatternColorDummy,*.cmd)

-------(1/32/741.16ms)-------
Remove : ***NOT NEEDED***
- 
- *.cmd

-------(1/32/741.34ms)-------
Remove : ***NOT NEEDED***
- 
- *.cmd

-------(1/32/741.51ms)-------
Remove : ***NOT NEEDED***
- *.bmp *.gif *.jpg *.png *.psd *.tif *.heic *.jpeg *.webp *.apng *.tga *.arw *.wmf
- *.cmd

-------(1/32/741.68ms)-------
Remove : ***NOT NEEDED***
- ^\d{0}\$
- *.cmd

-------(1/32/741.86ms)-------
Remove : ***NOT NEEDED***
- *.bmp *.gif *.jpg *.png *.psd *.tif *.jpeg *.heic *.svg *.webp *.wmf *.eps *.ico *.tga *.apng *.arw
- *.cmd

-------(1/32/742.03ms)-------
Remove : ***NOT NEEDED***
- *.zip *.7z *.rar *.cab *.zpaq
- *.cmd

-------(1/32/742.19ms)-------
Remove : ***NOT NEEDED***
- 
- *.cmd

-------(1/32/742.35ms)-------
Remove : ***NOT NEEDED***
- *.exe *.bat  *.lnk
- *.cmd

-------(1/32/742.54ms)-------
Remove : ***NOT NEEDED***
- ev:ext:7z;ace;arj;bz2;cab;gz;gzip;r00;r01;r02;r03;r04;r05;r06;r07;r08;r09;r10;r11;r12;r13;r14;r15;r16;r17;r18;r19;r20;r21;r22;r23;r24;r25;r26;r27;r28;r29;rar;tar;tgz;z;zip;jar;zpaq
- *.cmd

-------(1/32/742.7ms)-------
Remove : ***NOT NEEDED***
- ed:datemodified:today
- *.cmd

-------(1/32/742.86ms)-------
Remove : ***NOT NEEDED***
- ed:folder: !depth:0
- *.cmd

-------(1/32/743.03ms)-------
Remove : ***NOT NEEDED***
- 
- *.cmd

-------(1/32/743.19ms)-------
Remove : ***NOT NEEDED***
- *.mp4 *.avi *.mov *.flv *.webm
- *.cmd

-------(1/32/743.36ms)-------
Remove : ***NOT NEEDED***
- *.mp4 *.avi *.mov *webm *.flv *.mpg *.mkv *.wmv *.ogg
- *.cmd

-------(1/32/743.52ms)-------
Remove : ***NOT NEEDED***
- 
- *.cmd

-------(1/32/743.69ms)-------
Remove : ***NOT NEEDED***
- 
- *.cmd

-------(1/32/743.85ms)-------
Remove : ***NOT NEEDED***
- *.doc;*.docx;*.xls;*.xlsx;
- *.cmd

-------(1/32/744.02ms)-------
Remove : ***NOT NEEDED***
- ed: folder: childcount:0
- *.cmd

-------(1/32/744.18ms)-------
Remove : ***NOT NEEDED***
- ev:
- *.cmd

-------(1/32/744.34ms)-------
Remove : ***NOT NEEDED***
- 
- *.cmd

-------(1/21/744.52ms)-------
Call: _TC_SetPatterns_Add(PatternColorDummy,*.cmd)

-------(1/33/744.68ms)-------
Add : ***NEEDED***
- Ini    	C:\Tools\Wincmd\associations-searches.ini
- Section = 	searches
- Key = 	PatternColorDummy_SearchFor
- Current = 	*.PatternColorDummy;*.ion;*.vbs;*.ods
- Add = 	*.PatternColorDummy;*.ion;*.vbs;*.ods;*.cmd

Action:
- Add: [*.cmd] (TCColorKeyValueToAdd) => [PatternColorDummy] (TCColorKey)

-------(1/1/744.78ms)-------
Call: _IniWrite(): 
- IniFile	C:\Tools\Wincmd\associations-searches.ini
- IniSection	[searches]
- IniKey	PatternColorDummy_SearchFor
- IniKeyValue	=*.PatternColorDummy;*.ion;*.vbs;*.ods;*.cmd

-------(1/40/745.39ms)-------
(40#0) Process END  : for[3,3] = [Test.cmd] => in TCColorKey = [PatternColorDummy]

-------(1/40/745.48ms)-------
(40#1)Summary Processed Patterns to [PatternColorDummy]:
- $TCColorKeyValueToAdd_Cumultated = 
<*.ini>
<*.txt>
<*.cmd>

- $TCColorKeyValueToAdd_Processed  = 
<.ini>
<.txt>
<.cmd>

-------(1/0/745.68ms)-------
=== Main: Post process TC Restart ===

-------(1/20/745.92ms)-------
Call: _TC_Restart()
- $TCExe		[C:\Tools\Wincmd\totalcmd64.exe]
- $TCParams	[/N /I=]
- $TCIniFile	[C:\Tools\Wincmd\wincmd.ini]
-------
- $TknExe		[C:\Tools\Wincmd\totalcmd64.exe /N /I=C:\Tools\Wincmd\wincmd.ini]
- _GetPath($TCExe)	[C:\Tools\Wincmd\]

-------(1/0/748.28ms)-------
=== Main: Last Debug Dump ===

-------(1/0/748.85ms)-------
=== Dump Debug env./.ini ===
$rev = [2023.1.6.2]
@ScriptFullPath = [C:\Tools\Wincmd\PLUGINS\TC_PatternColor\TC_PatternColor.exe]
@TempDir = [C:\Users\horst\AppData\Local\Temp]
@OSType = [WIN32_NT]
@OSVersion/Build = [WIN_11 / 22621]
@OSArch/CPUArch = [X64 / X64]
-------
COMMANDER_DRIVE = [C:]
COMMANDER_PATH = [C:\Tools\Wincmd]
COMMANDER_EXE = [C:\Tools\Wincmd\totalcmd64.exe]
COMMANDER_INI = [C:\Tools\Wincmd\wincmd.ini]
COMMANDER_INSTANCE = [1]
-------
$CfgIniFile = [C:\Tools\Wincmd\PLUGINS\TC_PatternColor\TC_PatternColor.ini]
$TCIniFile = [C:\Tools\Wincmd\wincmd.ini]
- $TCIniFile_AlternateUserIni = [-]
- $TCIniFile_ColorRedirection = [3]
- $TCIniFile_SearchRedirection = [associations-searches.ini]

-------(1/0/749.74ms)-------
=== Dump Debug ini Var sections (END) ===
+ Dump TC Ini File= [C:\Tools\Wincmd\wincmd.ini]
  Section [Configuration]
    - AlternateUserIni = 
  Section [Colors]
    - InverseCursor = [0]
    - BackColor = [-1]
    - ForeColor = [-1]
    - MarkColor = [-1]
    - CursorColor = [16711680]
    - CursorText = [-1]
    - CompareText = [16711680]
    - CompareTextSel = [16711680]
    - ActiveTabColor = [128]
    - ActiveTitle = [37888]
    - ActiveTitleText = [16777215]
    - ColorFilter1 = [>Autorun]
    - ColorFilter1Color = [0]
    - ColorFilter8 = [>Color Image]
    - ColorFilter8Color = [8421440]
    - InverseSelection = [0]
    - BackColor2 = [-1]
    - ColorFilter2 = [>TwinKey Startup]
    - ColorFilter2Color = [0]
    - ColorFilter3 = [>Documents]
    - ColorFilter3Color = [3368448]
    - ColorFilter4 = [>Color blue]
    - ColorFilter4Color = [33023]
    - ColorFilter5 = [>Color Video]
    - ColorFilter5Color = [33023]
    - ColorFilter6 = [>Color Compressed]
    - ColorFilter6Color = [32768]
    - ColorFilter7 = [>Color Executable]
    - ColorFilter7Color = [16481536]
    - ThemedCursor = [1]
    - ColorFilter3ColorDark = [16750899,3368448]
    - ColorFilter4ColorDark = [16776960,33023]
    - ColorFilter7ColorDark = [60652,16481536]
    - ColorFilter5ColorDark = [8830969,33023]
    - ColorFilter8ColorDark = [32251,8421440]
    - ColorFilter9 = [>PatternColorDummy]
    - ColorFilter9Color = [255]
  Section [searches]
    - RedirectSection = [associations-searches.ini]
-------
+ Optional: Dump TC AlternateUserIni for File= []


=== Dump cfg .ini ===
1 Key=[TCForceSaveConf] / Value=[1]
2 Key=[TCIniFileBkpBeforeModif] / Value=[0]
3 Key=[TCIniFileBkpBeforeModifWarnOnBkpError] / Value=[0]
4 Key=[TCExitAndRestart] / Value=[1]
5 Key=[TCColorFilterPrefix] / Value=[PatternColor]
6 Key=[TCClass] / Value=[[CLASS:TTOTAL_CMD]]
7 Key=[TCExe] / Value=[]
8 Key=[TCIniFile] / Value=[]
9 Key=[TCParams] / Value=[/N /I=]
10 Key=[TCIniFileBkpFolder] / Value=[.ini.bkp\]
11 Key=[TCIniFileBkpDate] / Value=[1]
12 Key=[TCIniFileBkpExt] / Value=[.bkp]
13 Key=[TCIniFileIcoFolder] / Value=[.ico\]
14 Key=[TCExitBeforeModif] / Value=[1]
15 Key=[TCExitAlsoAnyOtherRunningTC] / Value=[1]
16 Key=[TCRestartAfterModif] / Value=[1]
17 Key=[TCCopyToClipboardTemplateButtonCode] / Value=[1]
18 Key=[TCKeyColorCheckInTCIniCreateIfMissing] / Value=[1]
19 Key=[TCKeyColorRemoveFromOtherKeys] / Value=[1]
20 Key=[TCKeyValueHandleAsExt] / Value=[1]
21 Key=[DEBUG] / Value=[1]
22 Key=[TCWinAPIMsg_ForceSaveConf] / Value=[580]
23 Key=[TCWinAPIMsg_ExitBeforeModif] / Value=[24340]
24 Key=[TCWinAPIMsg_ForceReloadColors] / Value=[-999]
25 Key=[TCKeyValueSeparator] / Value=[;]
26 Key=[TCKeyValuePrefix] / Value=["]
27 Key=[TCKeyValueSuffix] / Value=["]
28 Key=[TCIniColorSection] / Value=[Colors]
29 Key=[TCColorPrefix] / Value=[ColorFilter]
30 Key=[TCIniSearchSection] / Value=[searches]
31 Key=[TCSearchSuffix] / Value=[_SearchFor]
32 Key=[TCKeyFileListSeparator] / Value=[|]
33 Key=[TCForceSaveConfSleep] / Value=[128]
34 Key=[TCExitBeforeModifSleep] / Value=[256]
35 Key=[ListIniColorAndPatternsPrefixMsg] / Value=["[Colors] "]
36 Key=[ListIniColorAndPatternsPostfixMsg] / Value=[" for [searches] patterns:"]
37 Key=[ListIniColorAndPatternsSeparator] / Value=["_______________________________________________________________"]
38 Key=[TCKeyColorDefaultHexRGBValueColorIfMissing] / Value=[FF8000]
39 Key=[TCKeyColorDefaultDecValueColorIfMissing] / Value=[33023]
40 Key=[TCKeyColorDefaultSearchFlags] / Value=[0|002002000020|||||||||0000|||]
41 Key=[TCKeyAddSearchInAndText] / Value=[0]

Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

Really frustrating, makes me crazy, I don't understand what's going wrong...

This, except that seems running correctly on my side, giving a "[searches] / RedirectSection=associations-searches.ini" option like you.
The "only" (?) difference is: I run TC with following command line: "C:\Program Files (x86)\TotalCmd\TOTALCMD64.EXE" /N /i=%USERPROFILE%\Dev\TC\TC_Light_wincmd.ini

3 questions:
- are you sure having enabled the "color filter" (ie, the checkbox is "checked" for Menu:Configuration/Color : on left of button "Define colors by file type...") ? (obvious, but...)
- do you see any colored file for your already marked patterns (like *.jpg, *.7z, *.bat, etc...) ? (see previous question)
- how do you execute the TC portable version ? (did you give it a on command-line .ini file, like using "/N /I=" parameters ?)

Here a new version, without any notable correction, but a deeper Debug dump... if you have time to try it (set DEBUG=1) & give me back you Debug dump...

Version 2023.1.6.3 32/64
URL: TC_PatternColor_2023.1.6.3 (use the upper right download arrow/button) // md5: 4498fee08bcfb495f391099b70f6f19f *TC_PatternColor.exe
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: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Horst.Epp »

I have enabled Colors by file type and I see colors in the file lists from my definitons.
Starting the portable version just invokes the TC exe which find its ini in the same dir
because there is the setting UseIniInProgramDir=7 in the Configuration section of the wincmd.ini.
Sometime tomorrow I may test again.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

OK, thx for details.
Some news : I've reproduced your problem "configuration" on my side with a portable TC like yours

TC initial "config":
c:\Temp\TC_Exe\WINCMD.INI

Code: Select all

	[Configuration]
	UseIniInProgramDir=7
	[Colors]
	[searches]
	RedirectSection=associations-searches.ini
File created manually: "c:\Temp\TC_Exe\associations-searches.ini"

Code: Select all

	... is empty
- Running TC from "c:\Temp\TC_Exe\TOTALCMD64.EXE"
- Check in Menu/Configuration/Color that: [x] for checkbox "Define colors by file type..."
- Execute "c:\Temp\TC_Addons\TC_PatternColor.exe" one time and press "Cancel" on the information popup (note: there is a bug identified there on "OK" button *if* the "associations-searches.ini" file has none or empty [searches] section, will fix it later)
- Get the button, and paste it to my TC bar
- Select a file ("Dummy.abc") and click on the button
=> any file with "abc" ext is colored on my side


Get updated files:
c:\Temp\TC_Exe\WINCMD.INI

Code: Select all

	[Configuration]
	UseIniInProgramDir=7
	[Colors]
	ColorFilter1=>PatternColorDummy
	ColorFilter1Color=33023
	[searches]
	RedirectSection=associations-searches.ini
c:\Temp\TC_Exe\associations-searches.ini

Code: Select all

	[searches]
	PatternColorDummy_SearchFor=*.PatternColorDummy;*.abc
	PatternColorDummy_SearchFlags=0|002002000020|||||||||0000|||
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: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Horst.Epp »

I found the error in your tool !
With my selection of file your tool writes the following into the redirected associations-searches.ini:
PatternColorDummy_SearchFor=*.PatternColorDummy;*.ion;*.vbs;*.ods;*.cmd;*.txt
After removing the *. from *.PatternColorDummy the color definition works.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: TC_PatternColor: addon to apply color to File/Folder extension or name inside TC, on the fly

Post by *Mjolnir »

HAAAAAAA, I've already identified this problem, and thought I fixed it :oops:
I've previously found the fact that "PatternColorDummy_SearchFor=" is empty OR has "*." makes TC not apply any color... (that's why I always add such "*.PatternColorDummy")
=> Will fix this later (improve my search & remove for any solo "*." pattern, as I only check it on "add/remove", and not if already exists in the key value)
Really thx you for your help !
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
Post Reply