Can I color code a folder based by a specific file (or just a file name) inside that folder? Let's say I have three folders, two of which contain DONE.txt file. Can those folders with DONE.txt inside be color coded by a specific color and the one without remain uncolored, just black on white?
Thanks in advance!
Color code a folder if specific file is inside
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 4
- Joined: 2022-01-12, 12:56 UTC
Re: Color code a folder if specific file is inside
Yes
See e.g. "Color highlight a file (or folder) by any of its properties" at
https://ghisler.ch/board/viewtopic.php?p=352014#p352014
See e.g. "Color highlight a file (or folder) by any of its properties" at
https://ghisler.ch/board/viewtopic.php?p=352014#p352014
-
- Junior Member
- Posts: 4
- Joined: 2022-01-12, 12:56 UTC
Re: Color code a folder if specific file is inside
I'm glad that it can be done!Stefan2 wrote: 2022-01-12, 13:30 UTC Yes
See e.g. "Color highlight a file (or folder) by any of its properties" at
https://ghisler.ch/board/viewtopic.php?p=352014#p352014
But I'm pretty new to TC and didn't really understood how do I define that exact thing.
I can color code specific files or folders but cannot find how do I color code folders that include X file.
Re: Color code a folder if specific file is inside
You can use EmptyWDX 0.0.3 or FileInDir 64bit and create a specific filter for done.txt
ex for emptyWdx
ex for FileInDir
you can then colorize folder using the wdx plugin..
Go to configuration -> Color -> [Define Color by FileType]
Create a search type
go to plugins tab chose EmptyWdx or FileInDir + done-txt + = + YES
save as done-txt
then chose the color you want !
ex for emptyWdx
Code: Select all
[WDXContains]
1_filter=done.txt
1_type=0
1_Name=done-txt
1_Max=1
Code: Select all
[done-txt]
SearchFile=done.txt
Go to configuration -> Color -> [Define Color by FileType]
Create a search type
go to plugins tab chose EmptyWdx or FileInDir + done-txt + = + YES
save as done-txt
then chose the color you want !
Re: Color code a folder if specific file is inside
toxygen535 wrote: 2022-01-12, 13:57 UTC But I'm pretty new to TC and didn't really understood how do I define that exact thing.
I can color code specific files or folders but cannot find how do I color code folders that include X file.
Ahh, right, I think I didn't have documentet that part yet.
But user nsp also has a good alternatives.
I know, at start that all can gone quickly overwhelmed, so just ask if something is unclear (find some faq collections via my sig).
Here is a way via a script plugin ( I have tested that with "script_wdx" onlym but should work with "WinScript" the same way)
1)You need a plugin like http://www.totalcmd.net/plugring/script_wdx.html (this is TC 32-bit only)
or viewtopic.php?t=44032 --[wdx] WinScript Advanced Content Plugin (x86\x64) (new)
((( PLUGINs - Find / Installing / Removing a plugin: https://ghisler.ch/board/viewtopic.php?p=294671#p294671 )))
- create a script like this "containsfile.vbs" and save in folder of "script_wdx" -plugin:
Code: Select all
'// borrowed by Mr. Ghisler: https://ghisler.ch/board/viewtopic.php?p=284870#p284870
find="DONE.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
find=LCase(find)
l=Len(find)
If (fso.FolderExists(filename)) Then
Set fld = fso.GetFolder(filename)
Set fc = fld.Files
content = 0
For Each fil in fc
If (LCase(fil.Name)=find) Then
content = 1
End If
Next
Else
content = 2
End If
- modify the script.ini from "script_wdx" -plugin
Code: Select all
[Script]
Section=containsfile
[containsfile]
Script=Scripts\containsfile.vbs
LongName=1
ParseDirs=1
2) TC Menu Commands > Search
Search for:
Search in:
[Plugins]
script | Result | = | 1
[Load/Save]
[Save]
Save as: search_Find_DONE.txt
[Cancel] the search dialog
3) TC Menu Configuration > Options...
Color
Click at "[x] [Define colors by file type...]"
[Add...]
Select your "search_Find_DONE.txt"
[OK]
choose Color
[OK]
[OK]
[OK]
Now the folders containing a file named "DONE.txt" are colored in your choosen color.
HTH?

-
- Junior Member
- Posts: 4
- Joined: 2022-01-12, 12:56 UTC
Re: Color code a folder if specific file is inside
Thanks a lot to both of you!
For some reason only FileInDir worked for me. Tried with script_wdx and couldn't figure out how everything should work.
Again big thanks, I really appreciate your help!
For some reason only FileInDir worked for me. Tried with script_wdx and couldn't figure out how everything should work.
Again big thanks, I really appreciate your help!