How to switch "Define colors by file type" profile

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
vladimir.k
Junior Member
Junior Member
Posts: 3
Joined: 2017-01-24, 15:10 UTC

How to switch "Define colors by file type" profile

Post by *vladimir.k »

1) Is it possible to change "Define colors by file type" by hot-keys?

I would like to have 2 or more "Define colors by file type" profiles and switch it by hotkeys.


2) I set up 2 profile in "Configuration> View Mode> Auto Switch Mode" for specific folders. And would like to have different "Define colors by file type" profile for this "View Mode". How can I do this?

NB: Is it possible to get "View Mode" with any wdx plugin?
User avatar
tuska
Power Member
Power Member
Posts: 4120
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

I think you mixed up functions there:
"Define colors by file type" <==!==> "View Mode" + "Auto Switch Mode".

Define colors by file type: What you define as is automatically applied. No need for "View Mode".
But to answer your questions, which I treat only as theoretical. For me this would make no sense.

ad 1)
"Define colors by file type" by hot-keys? ==> IMHO only with em_commands.

Only exemplary pattern!

Step 1: Define colors by file type...
Configuration - Options - Color - Define colors by file type...
- Define selection -> Search for ...
- Plugin ... "Search in plugins:" -> Plugin: filex -> Property: EmptyDir -> OP: = -> Value: Yes
- Define selection -> Load/Save: e.g. Empty_dirs

Step 2: em_command for "Empty_dirs" [with button or without button: see Step 3 and afterwords Step 2: magnifying glass]
- right click on your buttonbar on an empty space - change
- push Button "Add"
- Click on the magnifying glass
- Category: Scroll down to -> usercmd.ini
- push Button "New..."
- New command name: em_Empty_dirs, OK-Button
- Command: %COMMANDER_EXE%
- Parameter: /S=F:LEmpty_dirs ***)
- Icon file: wcmicons.dll
- Tooltip: %COMMANDER_EXE% /S=F:LEmpty_dirs
- OK, OK, OK

***) TC-help (F1):
/S=F Open "Find Files" dialog without TC main window, e.g. totalcmd.exe /S=F "c:\start path"
Accepts additional parameters separated by a colon, e.g. /S=F:S1Lname
L<x> As LAST parameter: Load search with name <x>, e.g. "/S=F:Lmax 1 day old"

Step 3: Shortcut for "Empty_dirs"
Configuration - Options - Misc. - Hotkey: Choose Hotkey [for redefining] - Command: Empty_dirs
Click on green checkmark!

ad 2)
Configuration - View Mode - Auto-run commands: em_Empty_dirs,em_Empty_dir => Please see Help (F1)!
NB: Is it possible to get "View Mode" with any wdx plugin?
Yes => e.g. Configure custom columns... and take the name in View Mode, Field "Columns view".

Regards
Karl
vladimir.k
Junior Member
Junior Member
Posts: 3
Joined: 2017-01-24, 15:10 UTC

Post by *vladimir.k »

Thank you for tips how to do hotkeys and commands.

What I want to get.

I would like to have "Define colors by file type" for different "Columns view" or "View Mode" (with different background color) that can be triggered by "Auto Switch Mode" or by hotkeys.
For example:
open 1-st folder -> auto highlighted files from 1-st search pattern (files that have "date in names" (for example "2017_01_25.docx") older than tomorrow. I did it via WinScriptsAdv_wdx).
open 2-st folder -> auto highlighted files from 2-nd search pattern (files that older (real file properties) than 5\30\180 min, 24 hours etc - different colors).

press alt+F2 -> auto highlighted files from 1-st search pattern (in 1st or 2nd folder).
press alt+F3 -> auto highlighted files from 2-nd search pattern (in 1st or 2nd folder).

Simple "Define colors by file type" via search pattern do not let me check current "View Mode" or "Columns view" status (no variable, I don`t know any wdx plugin for this).

About you solution (its not work).
Step one ignore step 2 because Step 2 don not change search pattern in step 1.
Moreover
/S=F:LEmpty_dirs
just open search dialog with profile Empty_dirs.
It does not provide any search automatically.

Regards
VK
User avatar
tuska
Power Member
Power Member
Posts: 4120
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

2vladimir.k

http://totalcmd.net/plugring/WinScriptAdv.html

1. Create custom column view(s), e.g. DateInNamesOlderThanTomorrow
http://www.ghisler.ch/wiki/index.php/Custom_columns
Configuration > Options > Custom columns > New > Add column > click on '+' > choose winscriptsadv > choose "Properties" ...
2. Create View Mode(s) and take the name in View Mode, Field "Columns view" => DateInNamesOlderThanTomorrow
3. Choose your Background(s)
3a Auto-run commands: cm_100percent|cm_50percent (optional, if you want to get a better overview)
4. Configuration > Options > Auto Switch Mode
4a tick > Automatically switch view mode on directory change
4b Rule > +: Must match
4c Directory > D:\Data\ <= Only for D:\Data /// Direktory > D:\Data\* <= for D:\Data and sub-folders
==> Please see Help (F1) for more information!
5. Set this mode: DateInNamesOlderThanTomorrow, OK

6. Create custom column view => for 2-nd search pattern, e.g. FilesOlderThanHours
Continue with Pt. 2. ...

7. Configuration > Options > Misc. > Hotkey ALT + F2: Click on the magnifying glass > Category: usercmd.ini
Button "New" > New command Name em_DateInNamesOlderThanTomorrow, Command: cm_SrcViewModeList DateInNamesOlderThanTomorrow
(exakt name of View Mode in field "Colums view"!), OK, OK, Click on the green checkmark(!), OK

Please note that I could not get it to work with ALT+F2 to apply the view mode automatically,
because there must be a blank between cm_xxx and Name of Custom column - instead I got the list of view modes defined.
So if you want to get the views with only 1 click, I recommend to use a button with
Command: cm_SrcViewModeList DateInNamesOlderThanTomorrow.

With menue "Show"-"Custom View Modes" you'll get an overview about your defined View Modes too.
You should be able then to switch between your defined View Modes.
Command: cm_SrcViewMode0 sets the view to default.

I don't have a solution for your wishes regarding:
press alt+F2 -> auto highlighted files from 1-st search pattern (in 1st or 2nd folder).
press alt+F3 -> auto highlighted files from 2-nd search pattern (in 1st or 2nd folder).
Sorry!
About your solution (its not work).
For me it worked fine, but not automatically. It should only show how to approach the topic.
In practice, I would never have done something like that which is automatically done anyway.

Apropos topic: How to switch "Define colors by file type" profile ...
For me now it sounds more like "Custom columns_View Modes_Auto Switch Mode".

Regards
Karl
User avatar
tuska
Power Member
Power Member
Posts: 4120
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

On the basis of a further detailed examination of your request,
there are probably scripts here and unfortunately my remarks offer no solution.
(WinScriptsAdv_wdx - I have seen a .vbs script here: http://ghisler.ch/board/viewtopic.php?p=307862#307862)

If you have a .vbs script, then I can show you how to do this with a button or
via an em_command with shortcut in TC - see example below:
(How to redefine shortcuts is described above)

BUTTON

Code: Select all

TOTALCMD#BAR#DATA
em_Make_Copies

%COMMANDER_PATH%\Tools\Copies\WScript.exe
Make_Copies  ( Strg + K ) or Shift+F5 (Copy in same folder)

0
10004
COMMAND: em_Make_Copies

Code: Select all

Command:     %COMMANDER_PATH%\Tools\Copies\WScript.exe Make_Copies.vbs
Parameters:  %L
Start path:  %COMMANDER_PATH%\Tools\Copies\
Icon file:   %COMMANDER_PATH%\Tools\Copies\WScript.exe
Tooltip:     Make_Copies (Ctrl+K) or SHIFT+F5 (Copy in same folder) |Create a copy of all marked files where the string "_Copy" is inserted between NAME and EXTENSION
Website: https://en.wikipedia.org/wiki/Windows_Script_Host
Website: http://ghisler.ch/board/viewtopic.php?p=152568#152568 (Make_Copies.vbs, thread in german language)

I think from now on you can only get help from other forum participants for this topic.

Regards
Karl
vladimir.k
Junior Member
Junior Member
Posts: 3
Joined: 2017-01-24, 15:10 UTC

Post by *vladimir.k »

Thank you Karl,

I did very simple solution:

*1-st folder "Define colors by file type" depends from folder 1st seach pattern.
**2-nd folder "Define colors by file type" depends from folder 2nd seach pattern.

So I did simlink on 1-st folder => so 1 st folder have 2 paths:
one highlighted by * and second by **.
https://drive.google.com/open?id=0B7DpnrYnmo_RSTZGU0JlcnRtUEk
Its not perfect but its work.

Regards
VK
Post Reply