RESOLVED: Locate the object file dir under cursor at the destination panel and switch to it
Moderators: Hacker, petermad, Stefan2, white
RESOLVED: Locate the object file dir under cursor at the destination panel and switch to it
Hello guys,
Please tell if cm_GoToFirstEntry supports parameters for entry name (file or directory)
I would like to get the current entry under cursor, switch to the other panel and find that entry there...
In general I sort my folder on date and time, but even otherwise... it would help me several click every time I want to locate my files in hundreds of other entries.
Also I have tried the direct approach with executing Total Commander from this path or even switching to the specific folder with filename, BUT
the challenge here is to have this working through the SFTP plugin...
Thank you in advance
Please tell if cm_GoToFirstEntry supports parameters for entry name (file or directory)
I would like to get the current entry under cursor, switch to the other panel and find that entry there...
In general I sort my folder on date and time, but even otherwise... it would help me several click every time I want to locate my files in hundreds of other entries.
Also I have tried the direct approach with executing Total Commander from this path or even switching to the specific folder with filename, BUT
the challenge here is to have this working through the SFTP plugin...
Thank you in advance
Last edited by igarny on 2025-03-22, 20:33 UTC, edited 1 time in total.
Re: cm_GoToFirstEntry
as far as I understand this is impossible with the current implementation: viewtopic.php?t=76713
some sort of other automation, which would type in the letters of the file name in a cm_QuickSearch dialog?
this doesn't work as well: viewtopic.php?t=80677#p446567
some sort of other automation, which would type in the letters of the file name in a cm_QuickSearch dialog?
this doesn't work as well: viewtopic.php?t=80677#p446567
Re: cm_GoToFirstEntry
This would not be consistent with the command logic, where the cursor is set according to the current sorting.igarny wrote: 2025-03-21, 16:04 UTC Please tell if cm_GoToFirstEntry supports parameters for entry name (file or directory)
See 2) in my suggestion.igarny wrote: 2025-03-21, 16:04 UTC BUT the challenge here is to have this working through the SFTP plugin...
Overquoting is evil! π
Re: cm_GoToFirstEntry
Thanks @Fla$her
I am somehow not able to reproduce the dollar sign in your name
Thanks for highlighting the problem with cm_GoToFirstEntry
I have checked your topic and now I do remember I tried to deal with this problem and then gave up. You'll see I had been active there. I have now a batch script to traverse to a specific folder location managed by a plugin.
IMHO your use case is a more generalised version of my inquiry / call.
I have my doubts for a solution there, without a more generic power tool like AutoHotKey... see my post there under your topic.
Still I hope I am able to trick TC to locate the filename, which I know Mr. Ghisler already has a solution for it.
My goal:
I have my cursor ar a file in the active panel in a local folder and
want to switch to the same file on the opposite panel often a location under a file system or a packer plugin
this presumably requires some switching, searching and or filtering, for which I seek an automation
I know a solution is already applied by Mr.Ghisler.
Essentially what I am looking for is the solution applied for the cm_CompareFilesByContent.
This command applies a "magic" and can find automatically the file on the opposite panel coming from the same situation:
a file selected by the cursor in the active panel and a folder opened on the opposite panel
and this works within compressed archives and the SFTP plugin
I am somehow not able to reproduce the dollar sign in your name
Thanks for highlighting the problem with cm_GoToFirstEntry
I have checked your topic and now I do remember I tried to deal with this problem and then gave up. You'll see I had been active there. I have now a batch script to traverse to a specific folder location managed by a plugin.
IMHO your use case is a more generalised version of my inquiry / call.
I have my doubts for a solution there, without a more generic power tool like AutoHotKey... see my post there under your topic.
Still I hope I am able to trick TC to locate the filename, which I know Mr. Ghisler already has a solution for it.
My goal:
I have my cursor ar a file in the active panel in a local folder and
want to switch to the same file on the opposite panel often a location under a file system or a packer plugin
this presumably requires some switching, searching and or filtering, for which I seek an automation
I know a solution is already applied by Mr.Ghisler.
Essentially what I am looking for is the solution applied for the cm_CompareFilesByContent.
This command applies a "magic" and can find automatically the file on the opposite panel coming from the same situation:
a file selected by the cursor in the active panel and a folder opened on the opposite panel
and this works within compressed archives and the SFTP plugin
Re: cm_GoToFirstEntry
In the given topic, see the end of the first page and the beginning of the next one, where you coped with it.
I know we talked there, but I don't see that there was any talk of another panel.igarny wrote: 2025-03-22, 06:31 UTCI have checked your topic and now I do remember I tried to deal with this problem and then gave up. You'll see I had been active there.
I have such a vbs. But I think I'll make the code for Autorun. I'll add an example later in the help.igarny wrote: 2025-03-22, 06:31 UTCI have now a batch script to traverse to a specific folder location managed by a plugin.
What kind of case are you writing about, I don't understand?igarny wrote: 2025-03-22, 06:31 UTCIMHO your use case is a more generalised version of my inquiry / call.
What you are requesting here is more similar to the commands cm_TransferLeft (like Ctrl+Left) and cm_TransferRight (like Ctrl+Right), i.e. potentially cm_TransferTrg and cm_TransferSrc, which have the same problems from my list for cd, but without considering paths.igarny wrote: 2025-03-22, 06:31 UTCEssentially what I am looking for is the solution applied for the cm_CompareFilesByContent.
Overquoting is evil! π
Re: cm_GoToFirstEntry
Thanks for pointing these commands.
My point with cm_CompareFilesByContent is the MAGIC
Meaning the solution is known and probably can be derived from the implemented command.
would you suggest I can use TCFS2 to automate:
- get the filename under cursor
- switch to other panel
- invoke cm_QuickSearch
- provide the copied filename as input in the opened dialog for searching
Yes I agree about the essence of the action I am looking for. It is indeed similar.What you are requesting here is more similar to the commands cm_TransferLeft (like Ctrl+Left) and cm_TransferRight (like Ctrl+Right), i.e. potentially cm_TransferTrg and cm_TransferSrc, which have the same problems from my list for cd, but without considering paths
My point with cm_CompareFilesByContent is the MAGIC
Meaning the solution is known and probably can be derived from the implemented command.
would you suggest I can use TCFS2 to automate:
- get the filename under cursor
- switch to other panel
- invoke cm_QuickSearch
- provide the copied filename as input in the opened dialog for searching
Re: cm_GoToFirstEntry
There is no magic there, because it's easier to get paths and names and pass them to the window.
Since we need to save and restore a potential selection in the target panel, TCFS2 is not enough here, as it doesn't have a function for working with the clipboard.
It's easier for me to convert my 5-year-old vbs (it needs an additional dll) into autorun.cfg and post it here. Will it do?
Overquoting is evil! π
Re: cm_GoToFirstEntry
OK. now I understand the confusion I bring with the "magic" reference...
I call magic the ability of the cm_CompareFilesByContent command to locate the file on the remote panel without a selection of files in both panels.
I am looking for the automagic implementation of the first step in the process of the internal command, that finds by itself the correct file in the remote panel.
wrt the VBS, well it is my weak side, but sure I can learn from the master.
Thanks
I call magic the ability of the cm_CompareFilesByContent command to locate the file on the remote panel without a selection of files in both panels.
I am looking for the automagic implementation of the first step in the process of the internal command, that finds by itself the correct file in the remote panel.
wrt the VBS, well it is my weak side, but sure I can learn from the master.
Thanks
Re: cm_GoToFirstEntry
Autorun beta (Installation) and autorun.cfg:
Totalcmd.inc:
Code: Select all
LoadLibrary Plugins\Autorun_Runtime.dll
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Purpose: place the cursor on the item in the target panel with
# the same item name under the cursor in the active panel
# Condition: em_selectfilesb is needed, with selectfilesb
# in the first field and %Z%A1 in the second one.
# Parameter: 0 - the target panel will become active.
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
RegisterCommand 76549 PlaceCursorOnTheSameNameItemInTargetPanel
RegisterCommand 76550 PlaceCursorOnTheSameNameItemInTargetPanel 0
Func PlaceCursorOnTheSameNameItemInTargetPanel(lParam, SrcFocus=1)
Local Name, Clip
Name = GetCurrentItem(3)
If Name <> GetCurrentItem(4) Then
IsSelected = RequestInfo(11006)
SendMessage(RequestInfo(4), 11, 0)
SendCommand(4006, 0, 1)
If Name = '..' Then
If RequestInfo(1009) = 1 And RequestInfo(1010) = 1 Then
SendCommand(2049, 0, 1)
SendCommand(2056, 0, 1)
EndIf
Else
If IsSelected Then
Clip = ClipGet()
SendCommand(2017, 0, 1)
EndIf
SendCommand(524, 0, 1)
CommandExec('em_selectfilesb', '"' & Name & '"')
Sleep(10)
SendCommand(2049, 0, 1)
SendCommand(2053, 0, 1)
SendCommand(524, 0, 1)
If IsSelected Then
SendCommand(2033, 0, 1)
ClipPut(Clip)
EndIf
EndIf
SendMessage(RequestInfo(3), 11, 1)
EndIf
If SrcFocus Then SendCommand(4006)
EndFunc
cm_RightViewMode9=8259;etc. until 8499
cm_SetICurTrgSameNameItem=76549; ICur - inactive cursor
cm_FocusTrgSameNameItem=76550
Last edited by Fla$her on 2025-03-22, 14:39 UTC, edited 1 time in total.
Overquoting is evil! π
Re: cm_GoToFirstEntry
2igarny
This is what I use in my Extended menus for this task.I have my cursor ar a file in the active panel in a local folder and
want to switch to the same file on the opposite panel often a location under a file system or a packer plugin
this presumably requires some switching, searching and or filtering, for which I seek an automation
Code: Select all
[em_ext_GoToFirstEntry]
cmd=cm_GoToFirstEntry,cm_GotoPrev
menu=Go to first element
[em_ext_SaveSelectionTarget]
cmd=cm_FocusTrg,em_ext_GoToFirstEntry,cm_SaveSelection,cm_ClearAll,cm_FocusTrg
[em_ext_SelectItem]
cmd=SELECTFILESBT
param=%N
[em_ext_goto_item_opositepanel]
cmd=em_ext_SaveSelectionTarget,em_ext_SelectItem,cm_FocusTrg,cm_GotoNextSelected,cm_Unselect -1,cm_RestoreSelection
menu=Go to file/folder with same name in opposite panel if it exists - preserve file selection
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: cm_GoToFirstEntry
2petermad
Strangely, on my algorithm, the cm_RestoreSelection didn't work after cm_SaveSelection. I tried to change it now, but it didn't work.
In your case, there is one problem: if you select [..] in the active panel, the cursor will jump to the first folder in the target drive root.
You also need %Z for archives.
By the way, a couple of commands are enough here:
Strangely, on my algorithm, the cm_RestoreSelection didn't work after cm_SaveSelection. I tried to change it now, but it didn't work.
In your case, there is one problem: if you select [..] in the active panel, the cursor will jump to the first folder in the target drive root.
You also need %Z for archives.
By the way, a couple of commands are enough here:
Code: Select all
[em_SelectSameNameItem]
cmd=SELECTFILESB
param="%Z%M"
[em_NavigateToSameNameTrgItem]
cmd=cm_FocusTrg,cm_GoToFirstEntry,cm_GotoPrev,cm_SaveSelection,cm_ClearAll,em_SelectSameNameItem,cm_GotoNextSelected,cm_Unselect -1,cm_RestoreSelection
menu=Navigate to the same name item in the target panel, if exists
Overquoting is evil! π
Re: cm_GoToFirstEntry
Fla$her wrote: 2025-03-22, 11:01 UTC Autorun beta (Installation) and autorun.cfg:Totalcmd.inc:Code: Select all
LoadLibrary Plugins\Autorun_Runtime.dll #βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # Purpose: place the cursor on the item in the target panel with # the same item name under the cursor in the active panel # Condition: em_selectfilesb is needed, with selectfilesb # in the first field and %Z%A1 in the second one. # Parameter: 0 - the target panel will become active. #βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ RegisterCommand 76549 PlaceCursorOnTheSameNameItemInTargetPanel RegisterCommand 76550 PlaceCursorOnTheSameNameItemInTargetPanel 0 Func PlaceCursorOnTheSameNameItemInTargetPanel(lParam, SrcFocus=1) Local Name, Clip Name = GetCurrentItem(3) If Name <> GetCurrentItem(4) Then IsSelected = RequestInfo(11006) SendMessage(RequestInfo(4), 11, 0) SendCommand(4006, 0, 1) If Name = '..' Then If RequestInfo(1009) = 1 And RequestInfo(1010) = 1 Then SendCommand(2049, 0, 1) SendCommand(2056, 0, 1) EndIf Else If IsSelected Then Clip = ClipGet() SendCommand(2017, 0, 1) EndIf SendCommand(524, 0, 1) CommandExec('em_selectfilesb', '"' & Name & '"') Sleep(10) SendCommand(2049, 0, 1) SendCommand(2053, 0, 1) SendCommand(524, 0, 1) If IsSelected Then SendCommand(2033, 0, 1) ClipPut(Clip) EndIf EndIf SendMessage(RequestInfo(3), 11, 1) EndIf If SrcFocus Then SendCommand(4006) EndFunc
cm_RightViewMode9=8259;etc. until 8499
cm_SetICurTrgSameNameItem=76549; ICur - inactive cursor
cm_FocusTrgSameNameItem=76550
So I played through the procedure of installing the Autorun plugin....
I see it is very powerful and probably can move mountains for TC especially if it can register new commands...
So far, so good..
I have the Autorun registered as Color scheme >Autorun-color-template, and while doing this I found out that TCFS2tools also has a registration...
I have added the script from Fla$er in the Autorun.cfg file. Restarted TC
Unfortunately I do not find any registrations of new commands in the TC.inc
Then I decided to make a test and went through the documentation. At the end of the HLP file there are examples.
I simply took this one and added it before the script (the LoadLibrary)
Code: Select all
SetHotkeyAction /D /S /K:C /H:N FindFiles 0
"function name not found SetHotkeyAction"
This makes me think Autorun loads, the script loads, but no registration in the tc.inc can be found
Re: cm_GoToFirstEntry
Apart of this..
Both solutions based on extended menus work fine in the general usecase which is quite sufficient for me.
I must admit this SELECTFILES modifier is a miss on my side
Thank you for your expertize!
Both solutions based on extended menus work fine in the general usecase which is quite sufficient for me.
I must admit this SELECTFILES modifier is a miss on my side
Thank you for your expertize!
Re: RESOLVED: Locate the object file dir under cursor at the destination panel and switch to it
2Fla$her
I cannot reproduce that. If I place the cursor on [..] in the active side, the cursor is set on [..] in the target side - but I get an error sound in that case. (tested with a clean ini file)if you select [..] in the active panel, the cursor will jump to the first folder in the target drive root.
Sure - I just also use em_ext_GoToFirstEntry in the menu, and i previously also used em_ext_SaveSelectionTarget for another em_command.By the way, a couple of commands are enough here:
If works fine without %Z if the archive is on the target side, and it does not work if the archive is the source (active) side neither with nor without %ZYou also need %Z for archives.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: cm_GoToFirstEntry
Are you kidding? The specified additives in Totalcmd.inc must be added manually.igarny wrote: 2025-03-22, 19:46 UTC Unfortunately I do not find any registrations of new commands in the TC.inc
This makes me think Autorun loads, the script loads, but no registration in the tc.inc can be found

It requires loading Autorun_Tweaks.dll, and in order to avoid other problems, it's logical to load all available libraries at once. I don't write them in every example to avoid duplication.igarny wrote: 2025-03-22, 19:46 UTC I simply took this one and added it before the script (the LoadLibrary)Code: Select all
SetHotkeyAction /D /S /K:C /H:N FindFiles 0
For general and secondary questions, it's better to contact here - I will answer as much as possible.
By default, there is no [..] in the drive root.petermad wrote: 2025-03-22, 23:48 UTC I cannot reproduce that. If I place the cursor on [..] in the active side, the cursor is set on [..] in the target side
I have system sounds disabled. But in the script, I check for [..] in both panels to avoid this error.but I get an error sound in that case.
It's clear, but in this case, the combination of cm_FocusTrg,em_ext_SelectItem,cm_FocusTrg looks redundant, so I replaced them with one with SELECTFILESB and "%Z%M".Sure - I just also use em_ext_GoToFirstEntry in the menu, and i previously also used em_ext_SaveSelectionTarget for another em_command.
You're doing something wrong. Both of my solutions work for me. Edit for your case:and it does not work if the archive is the source (active) side neither with nor without %Z
param=%N%Z
Overquoting is evil! π