Find same file in target panel

English support forum

Moderators: Hacker, petermad, Stefan2, white

dinky78
Junior Member
Junior Member
Posts: 2
Joined: 2008-06-26, 16:38 UTC

Find same file in target panel

Post by *dinky78 »

Hi everybody!

A feature I am DESPERATELY waiting for (or still trying to find) in Total Commander is the ability to quickly find a file in the target panel which has the same name as the file under the cursor in the source panel.

This shall work independently from the directories that are currently active... only the file name shall be found. I know, there is Save/Restore Selection, but that is not what I want. I want the cursor to jump to the file I am looking for.

Scenario:
- Move the cursor to a file in the source panel
- Do something magic (Hotkey, Menu selection, whatever)
- The target panel is activated and the cursor jumps to the file with the same name.
- If there is no corresponding file, nothing happens.

I think this would be a very simple feature to implement, but would be a HUGE time-saver for me!!!

Could this be achieved with a plugin?
Or is there already such a function (which after all these years I still did not find :-) )?

Thanks alot & Greetz,
René
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Just use this in TC's start menu, as a button, etc.
(labeled e.g. "focus current file in target window"):

Code: Select all

Command : %comspec% /c start ""
Parameters: "%%COMMANDER_PATH%%\TOTALCMD.EXE" /O /S /R=%T%N
I hope this fits your needs.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
dinky78
Junior Member
Junior Member
Posts: 2
Joined: 2008-06-26, 16:38 UTC

Post by *dinky78 »

Thanx A.L.O.T. StatusQuo, you saved my day :-)

That's exactly what I want (except it does not focus on the target window after execution, but that is not a big deal :-) )

If you find the time, I would appreciate it if you could give me a short info about what exactly you are doing there with these commands.... The Total Commander Help file did not help much... :-(

Thanx again!
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

dinky78,
Or, Ctrl-U.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

[mod]Moved to the English forum.

Hacker (Moderator)[/mod]
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

dinky78 wrote:what exactly you are doing there with these commands.... The Total Commander Help file did not help much...
Some is in TC's help chapter 4.a), command line parameters.

What it does:
Command : %comspec% /c start ""
...because the system variable "COMMANDER_PATH" can't be expanded in TC's "Command" line,
so the system's command line is used to start the command specified in the "Parameters" line
Parameters: "%%COMMANDER_PATH%%\TOTALCMD.EXE" /O /S /R=%T%N
%%COMMANDER_PATH%% is the path TC is installed in (percent signs for system variables have to be doubled in the "parameters" section)
/O: pass parameters to already running instance of TC
/S: interpret "/R" as target instead of right
/R: path to be opened in target panel (because of /S)
%T: path in target panel
%N: file name in source/active panel
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
white
Power Member
Power Member
Posts: 5982
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Or.......

Create a button, menu entry, directory menu entry or alias (through user command) which executes "cd" with parameter "%M".

Then, to go to a file with the same name in the other panel do this:

:arrow: First hit the Tab key or click somewhere in the other panel
:arrow: Then click the button or menu entry or directory menu entry or type the alias and press Enter

C'est très simple, n'est ce pas?
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

white wrote:"cd" with parameter "%M".
...
C'est très simple, n'est ce pas?
Oui, indeed a nice solution.

BTW, it doesn't seem to matter if "%M" is specified with or without double quotes
(although TC does not auto-add them - checked with "?" in the parameter).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

2dinky78
That's exactly what I want (except it does not focus on the target window after execution, but that is not a big deal Smile )
This can also be done by adding parameter "/P=R":

Code: Select all

Command : %comspec% /c start ""
Parameters: "%%COMMANDER_PATH%%\TOTALCMD.EXE" /O /S /P=R /R=%T%N 
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
white
Power Member
Power Member
Posts: 5982
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

This can also be done by adding parameter "/P=R":
No that does not work. Apparently the /s switch does not work for the /P switch.
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

white wrote:No that does not work. Apparently the /s switch does not work for the /P switch.
Oops, you're right.
So activating the target panel only works when the left panel was active, panels are not switched when called from the right panel.
Well, better than nothing. :)

[Edit] Typo removed.
Last edited by StatusQuo on 2008-07-07, 23:20 UTC, edited 1 time in total.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
white
Power Member
Power Member
Posts: 5982
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Maybe we should make a request for it. One would expect the /S switch to also work for the /P switch. And it can be useful as this example has shown.
User avatar
white
Power Member
Power Member
Posts: 5982
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

StatusQuo wrote: because the system variable "COMMANDER_PATH" can't be expanded in TC's "Command" line
No problem on my system (Windows 98SE). Only it is not a environment variable at my system, but a virtual variable only.
StatusQuo wrote: %%COMMANDER_PATH%% is the path TC is installed in (percent signs for system variables have to be doubled in the "parameters" section)
It's not a environment at my system (Windows 98SE), so this does not work for me. On my system, the variable %COMMANDER_PATH% is only a virtual variable, which can be used only in Total Commander by Total Commander.

So for me this works:

Code: Select all

Command   : %COMMANDER_PATH%\TOTALCMD.EXE
Parameters: /O /S /R=%T%N
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

white wrote:Maybe we should make a request for it. One would expect the /S switch to also work for the /P switch.
Request: Make parameter /P consider /S (source/target instead of L/R)
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

white wrote:It's not a environment at my system (Windows 98SE), so this does not work for me. On my system, the variable %COMMANDER_PATH% is only a virtual variable, which can be used only in Total Commander by Total Commander.
Indeed, this seems to be different from Win2k/XP.
StatusQuo wrote:because the system variable "COMMANDER_PATH" can't be expanded in TC's "Command" line
As I can not reproduce that anymore (now this works here, too), the Win98 version should also work on Win2k/XP.
Added double quotes for TC installations in e.g. "C:\Program Files" and /P=R (yet working for active panel=left only) this would be:

Code: Select all

Command   : "%COMMANDER_PATH%\TOTALCMD.EXE"
Parameters: /O /S /R=%T%N /P=R
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
Post Reply