A
A
andead2019-02-27 23:31:58
Total Commander
andead, 2019-02-27 23:31:58

How to bind a hotkey to open the next/previous folder in Total Commander?

For example, there is a structure like this:

C:\
-- dir1
---- dir2
---- dir3
---- dir4

I want, being in C:\dir1\dir3, using a hotkey to move between adjacent folders. Those. pressed for example Ctrl+→, the following directory was opened C:\dir1\dir4; pressed Ctrl+←, the previous C:\dir1\dir2 was opened.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
andead, 2019-03-09
@andead

I wrote a simple php script that opens the next / previous directory in the command line - https://gist.github.com/xandeadx/6ca1b50235b93b4f9...
Well, then I added two buttons - forward, back:
5c83e2f61854a128513989.png

R
Rainbow Spike, 2019-02-28
@DrYukon

These keys are bound to clone the path of the current panel to the inactive one, and this is often useful. It is better to occupy less important keys, for example, F9-F12. The next edge - Total cannot do things like switch to a neighbor, so only a script in any automation language (cron, AutoIt and the like) helps here. The script on Autoit is like this:

HotKeySet('{F9}', 'Prev')
HotKeySet('{F10}', 'Forv')
HotKeySet('{F11}', 'Stop')

While 1 ; цикл вечного ожидания действий
  Sleep(10)
WEnd

Func Prev()
  WinActivate("Total Commander") ; перейти в ТК
  Send("^{HOME}") ; выход в начало папки
  Send("{ENTER}") ; выход из папки
  Send("{UP}") ; переход выше
  Send("{ENTER}") ; заход в следующую папку
EndFunc

Func Forv()
  WinActivate("Total Commander") ; перейти в ТК
  Send("^{HOME}") ; выход в начало папки
  Send("{ENTER}") ; выход из папки
  Send("{DOWN}") ; переход ниже
  Send("{ENTER}") ; заход в следующую папку
EndFunc

Func Stop()
  Exit
EndFunc
As follows from the script, by pressing the F9 / F10 button (note that this is a global hotkey, this pressing will not reach other programs), it will transfer focus to Total in the current panel (without checking whether it is on the right or left; although this can also be added ) re-enter the previous/next folder and wait for action again. By F11, the script is unloaded, which can be seen from the disappearance of the Autoita icon in the system tray.
Save the quote to the file "go to neighboring folders.au3", install Autoit https://www.autoitscript.com/site/autoit/downloads/, run the au3 file, when asked about the program to open, as usual, specify the path to executable. This language is also able to control the mouse, receive introductory instructions through dialog boxes, fill out forms, and launch meteorological rockets from Baikonur. Not a joke.
// Corrected the script. Just now I saw that the question is about moving in both directions ≺(⊙‿⊙)≻
Instead of Home + Enter commands in both functions, you can use
Send("^cm_GoToParent") ; выход из папки
  Send("{ENTER}") ; выполнить
but it doesn't change the point

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question