File selected in one window also selected in other window

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
rwclohessy
Junior Member
Junior Member
Posts: 2
Joined: 2021-01-06, 10:15 UTC

File selected in one window also selected in other window

Post by *rwclohessy »

Hi All
Is it possible to left click highlight or right click (red) select a file in a window that's in the File All step mode which then automatically highlights, selects &/or focuses on the same file in the other window that's is the Thumbnail display modes?
I'm updating a CAD drafting library that has over 22,000 files within many sub sub folders, and want to have the file's full details shown adjacent the same file's thumbnail image.
I know when you right click (red) select a file in a All File Details window & then toggle the same window to the thumbnail mode, the selected file's name is also in red & in focus but then i need toggle back & forth between the two window modes for each new file to review.
Thanks
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: File selected in one window also selected in other window

Post by *nsp »

Hi,

you can select file in target panel with same name as source using the following code:

Code: Select all

cmd=SELECTFILESBTS
param=%Z%S
If you define a user command like em_SelectInTarget you can reuse it to define alias, hotkey, button.
for other samples. you can read Stefan post.
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: File selected in one window also selected in other window

Post by *petermad »

2rwclohessy
My Extended Menu (see signature) has such an option: https://madsenworld.dk/tcmd/selectsameinotherpanel.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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Re: File selected in one window also selected in other window

Post by *umbra »

A different approach could be using a separate quick view window (Ctrl+Shift+Q). It would free the other panel for something more useful. Or a classic quick view (Ctrl+Q). Both would follow your cursor in one of the panels and automatically update the preview.
Windows 7 Pro x64, Windows 10 Pro x64
rwclohessy
Junior Member
Junior Member
Posts: 2
Joined: 2021-01-06, 10:15 UTC

Re: File selected in one window also selected in other window

Post by *rwclohessy »

Hi Guys Many thanks for your replies and solutions. I wasn't able to replicate nsp or umbra's solutions due to my poor coding skills &/or understanding. Thks petermad as I was able to utilize your Extended Menu. Is there a way to automatically bring into focus / display on the Target Side window the selected file(s)? I have many folders where only a portion of the files are able to be displayed and need to scroll up or down to find the highlighted selected file(s). Thks
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: File selected in one window also selected in other window

Post by *nsp »

if you use petermad extended menu, on filter menu, you have in the option to Only show selected files (filter max 1018 chars).
Go to target side with selected files and then chose the filter. The filter will apply to all tabs in same side.
This is using a user command

Code: Select all

cmd:CD
param: ;%S ?"
You also have a TC command cm_ShowOnlySelected witch is temporary and just apply to current tab. You can type the command on the command bar or add a button copy following code, and past to TC toolbar(R'Click paste):

Code: Select all

TOTALCMD#BAR#DATA
cm_ShowOnlySelected

wciconex.dll,253



2023
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: File selected in one window also selected in other window

Post by *petermad »

2rwclohessy
Is there a way to automatically bring into focus / display on the Target Side window the selected file(s)? I have many folders where only a portion of the files are able to be displayed and need to scroll up or down to find the highlighted selected file(s). Thks
I have a solution, but it requires that you put some commands in your usercmd.ini file first:

Code: Select all

[em_goto_item_opositepanel0]
cmd=cm_FocusTrg,cm_SaveSelection,cm_GoToFirstEntry,cm_GotoPrev,cm_ClearAll

[em_goto_item_opositepanel1]
cmd=SELECTFILESB
param=%M

[em_goto_item_opositepanel]
cmd=em_goto_item_opositepanel0,em_goto_item_opositepanel1,cm_GotoNextSelected,cm_RestoreSelection
Then you can make a button like this:

Code: Select all

TOTALCMD#BAR#DATA
em_goto_item_opositepanel

WCMICONS.DLL,19
Select and go to file with same name in opposite panel if it exists


-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
You can also use the command em_goto_item_opositepanel in the Main menu, in the Start menu or you can assign a Keyboard shortcut to the command.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: File selected in one window also selected in other window

Post by *petermad »

rwclohessy pointed my attention to my solution not working when there is a space in the file name under the cursor. It seem to be because SELECTFILESB doesn't work with %M or "%M" when used in an em_command (it works when used directly in a button).

So I have changed the commands:

Code: Select all

[em_goto_item_opositepanel0]
cmd=cm_FocusTrg,cm_SaveSelection,cm_GoToFirstEntry,cm_GotoPrev,cm_ClearAll,cm_FocusTrg

[em_goto_item_opositepanel1]
cmd=SELECTFILESBT
param=%N

[em_goto_item_opositepanel]
cmd=em_goto_item_opositepanel0,em_goto_item_opositepanel1,cm_FocusTrg,cm_GotoNextSelected,cm_Unselect,cm_GotoPrev,cm_RestoreSelection
and the button:

Code: Select all

TOTALCMD#BAR#DATA
em_goto_item_opositepanel

wcmicons.dll,19
Go to file/dir with same name in opposite panel if it exists


-1

I have posted this bug report about the handeling of %M in cases like this: https://www.ghisler.ch/board/viewtopic.php?f=32&t=73672
Last edited by petermad on 2021-01-15, 13:37 UTC, edited 2 times in total.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: File selected in one window also selected in other window

Post by *petermad »

I don't see any change in the code for the button compared to the previous post ?
I make two more cm_FocusTrg and use param=%N in stead of param=%M in the commands - and have changed the caption text for the button.
Also the new versions of the em_commands no longer selects an entry.
That is on purpose - the previous approach only selected the file if no other files were selected in the target panel - so that was not consistant - now the file is still focused but whether it is selected depens on its previous state. that is why I also changed the caption "Select and go to file with same name in opposite panel if it exists" to: "Go to file/dir with same name in opposite panel if it exists"

Notice: I have posted this bug report about the handeling of %M in cases like this: https://www.ghisler.ch/board/viewtopic.php?f=32&t=73672
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: File selected in one window also selected in other window

Post by *petermad »

There is the problem with the commands above, that if the cursor is on the last file in the list (in the target side), then it will be the file above the last file that is highlighted.

If preserving any prior selections in the target folder is not important, and you don't mind that the file get selected (red) in the target then you can use these commands in stead:

Code: Select all

[em_goto_item_opositepanel0]
cmd=cm_FocusTrg,cm_GoToFirstEntry,cm_GotoPrev,cm_ClearAll,cm_FocusTrg

[em_goto_item_opositepanel1]
cmd=SELECTFILESBT
param=%N

[em_goto_item_opositepanel]
cmd=em_goto_item_opositepanel0,em_goto_item_opositepanel1,cm_FocusTrg,cm_GotoNextSelected
menu=Select and go to file with same name in opposite panel if it exists
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply