How to Highlight all folders with a specific color?

English support forum

Moderators: white, Hacker, petermad, Stefan2

fc62
Junior Member
Junior Member
Posts: 52
Joined: 2007-02-06, 16:30 UTC

How to Highlight all folders with a specific color?

Post by *fc62 »

Hello,
I woluld like to highlight all folders with a specific colur, but I'm not able to indicate in "Define colors by file type" how to select all folders.

Is it possible? Thanks
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2fc62

Define colors by filetype->Add->Define->Advanced->Attributes->Directory
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
jjk
Member
Member
Posts: 181
Joined: 2003-07-03, 10:41 UTC

Post by *jjk »

Hi fc62
Try Configuration > Colors > Define colors by file type > Add
In dialog box, choose Config button, then in "Config selection" dialog box, choose second tab (Add...), check Attribs, check Directory, then Save button. Give it "directories" name for example.
Now you go back to previous dialog box. Click on Confirm. Finally choose a color in the palette, confirm twice.
Sorry if english is not your language, mine neither, so I had to guess button captions.
fc62
Junior Member
Junior Member
Posts: 52
Joined: 2007-02-06, 16:30 UTC

Post by *fc62 »

Many thanks!
fc62
Junior Member
Junior Member
Posts: 52
Joined: 2007-02-06, 16:30 UTC

Post by *fc62 »

Hello, I have another question: I would like to highlight only the files with extension *.lnk and the link is to a folder. I tried to use shelldetails plugin to determinate the origin of the link but I haven't been able to find the right field selection
Do you think it would be possible?
thanks
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2fc62
That's a quite advanced task. The most appropriate content plugin for this task would be 'Shortcut' ( http://totalcmd.net/plugring/shortcut.html ). It has a field 'Path' but I'm not aware of any ways to find out if this is a folder or a file.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Perhaps script content plugin may be used with approriate script, but I don't know how fast it will be.

Also regular expression may help to filter some file paths in Shortcut.Path field (names with dots etc) but it is not reliable...
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Of course it can be solved in a content plugin (with script or natively) but I don't think it's the best solution. The use case here is another example of the lack of post-processing capabiltiies. We have just a few operators and that's it.
Using the result of one content plugin field value as input of another would be the best solution.
fc62
Junior Member
Junior Member
Posts: 52
Joined: 2007-02-06, 16:30 UTC

Post by *fc62 »

I just tried to use shortcut plugin but I didn't find any useful selection. Maybe script content plugin could be useful but I'm not skilled with scripts. My question is: If we right-click for attributes of a link to a Folder, in the Tab "Link", we can see a file called "Type:" (I’m not sure if the translation is correct because my system is in Italian). This field correctly indicate the origin type of the link: doc, txt, acrobat, etc. and it perfectly recognizes a folder link. It would be perfect to be able to detect that attribute but I don’t know how.
fc62
Junior Member
Junior Member
Posts: 52
Joined: 2007-02-06, 16:30 UTC

Post by *fc62 »

Just in case, how can ask to someone to help me writing a script for my purpose? Thanks
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2fc62
1. Download and install AHK - https://autohotkey.com/
2. Download and install - WinScript Advanced Content Plugin http://ghisler.ch/board/viewtopic.php?t=44032
3. Download and copy to the folder Scripts in home dir of the WinScript Advanced Content Plugin script Folder_Test.ahk - http://rgho.st/8ss7L49NQ
4. Open in any editor options.ini in the home dir of the WinScript Advanced Content Plugin and add |Folder_Test to the end of ActiveScripts= line in section [Script]
5. Add section

[Folder_Test]
Script=Folder_Test.ahk
content=Folder_Test
extensions=lnk
FoldersPaths=0

to options.ini

6. In section [ExeScriptParsers] find string ahk= and write here the correct path to AHK executable
7. Configuration > Colors > Define colors by file type > Add or edit you defenition for LNK files:
7.1 Search for - *.*
7.2 go to Plugins tab and choose winscriptsadv plugin, property - Folder_Test, OP - contains, value - 1
Save all and enjoy!
Last edited by Ovg on 2016-09-21, 07:33 UTC, edited 2 times in total.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
fc62
Junior Member
Junior Member
Posts: 52
Joined: 2007-02-06, 16:30 UTC

Post by *fc62 »

Ovq,
I did all your (very clear) instructions and everything runs well but the script seems not able to select ONLY folder shortcut links but also all links to other kind of files.
Did I do something wrong?
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

Hmm, for me all working fine.

Did you have another rules for lnk files? If any exist, remove them.

I have recorded a test gif file for you - http://rgho.st/7xyLBW4hB
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Ovg wrote: 7.2 go to Plugins tab and choose winscriptsadv plugin, property - Folder Test, OP - contains, value - 1
property - Folder Test,

shouldn't that be
property - Folder_Test, ?






 
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2Stefan2
Indeed! My mistake, thank you, but it doesn't matter in this case - choice is made from the predefined menu ... I have edited my post with instructions.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
Post Reply