QuickSwitch and JumpToFolder AHK scripts

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6950
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Horst.Epp »

Restart doesn't help.
I make no sense to create a dir which TC never reads.

Usercmd.ini is of course under C:\tools\wincmd\usercmd.ini in my case.

The log is now:

Report about error: https://github.com/JoyHak/QuickSwitch/issues/new?template=bug-report.yaml
AHK 1.1.37.02
Windows 10 Home 24H2 | 26100 de-DE

Script is compiled. Version: 0.0.0.0
64-bit script for 64-bit system

21.04 06:22:40 Found Total Commander config: 'C:\Tools\Wincmd\wincmd.ini'
21.04 06:22:40 [TotalCmd config] Please create this file manually: 'C:\Tools\usercmd\usercmd.ini' FileAppend 1
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6950
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Horst.Epp »

Rafaello wrote: 2025-04-21, 16:25 UTC Can you record some demo of what happens when opening the menu? TC window should be visible on the video. I don't understand why the console didn't open.
What menu do you mean ?
Your script doesn't show any menu when it's started form inside of TC.
When a tool like an editor creates an Open/Save dialog, there will be not any TC window on the screen.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

Horst.Epp wrote: 2025-04-21, 16:31 UTC What menu do you mean ?
I meant just QuickSwitch bc... it's a menu
Horst.Epp wrote: 2025-04-21, 16:31 UTC When a tool like an editor creates an Open/Save dialog, there will be not any TC window on the screen.
You can open file dialog and then TC window. It may help me to understand why your TC console doesnt work.

Fixed directory name replacing from wincmd to usercmd.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6950
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Horst.Epp »

Version 1.4.2 works fine :)
It shows all open tabs in Open/Save dialogs
and produces no error messages.
The only cosmetic error is the info in the log, it should contain the name of the created em_command
[EM_ScriptCommand_QuickSwitch_SaveAllTabs]

Actual log:

21.04 07:54:39 [TotalCmd console] Unable to find console
21.04 07:54:39 Found Total Commander config: 'C:\Tools\Wincmd\wincmd.ini'
21.04 07:54:39 Created user command 'cmd=SaveTabs2
param=C:\Users\horst\AppData\Local\Temp\TotalTabs.tab' in 'C:\Tools\Wincmd\usercmd.ini'
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

I'm very happy! I left this info because the script reads the result after writing without the EM_ section name itself. This ensures that the information is actually recorded in the file. In case of read / write failure, a new attempt is made.

The question remains: should the app search for a configuration named wincmd.ini in the current directory (excluding /i switch and the path in the registry, there is no search by name)? Maybe the name may be different.

Also, TC does not report any information if the commands doesn't exist. If the tabbed file could not be retrieved in 2.5 seconds, the application searches and reads wincmd.ini and creates a new command in usercmd.ini if there is none. But this is not a very reliable verification option...
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

It is also not clear why TC does not open the console. Previously, it did not respond to any requests if child windows were open (like Xyplorer)
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6950
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Horst.Epp »

Rafaello wrote: 2025-04-21, 18:29 UTC It is also not clear why TC does not open the console. Previously, it did not respond to any requests if child windows were open (like Xyplorer)
You should not try to search for wincmd.ini, as the name can be anything.
The current version works fine for me with a combination of Total Commander and XYplorer tabs.
What I really miss, compared to the original Quick Switch, are the icons to know what tabs belong to which file manager.

You should wait if some users with non-portable setup also have success.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

Horst.Epp wrote: 2025-04-21, 19:11 UTC You should not try to search for wincmd.ini, as the name can be anything.
Then how search for the config in current TC directory? This is the last step of the search after the console and /i the switch steps, which are not looking for the name, but the contents.
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

I think your console won't start because TC is running as an administrator. Although I do not know how to automatically restart the script in administrator mode...
KozakMak
Senior Member
Senior Member
Posts: 478
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *KozakMak »

BUG. The menu appears in find people dialog in Active directory "Users and computers" console

and yes, auto adding to startup is evil


hmm, another one

---------------------------
QuickSwitch-1.4.2-x64.exe
---------------------------
Error: Invalid option.

Specifically: x y

Line#
---> 937: Gui,Show,"AutoSize x" WinX " y" WinY + 100,Menu settings

The current thread will exit.
---------------------------
ОК
---------------------------
OS: Win10 | TC: latest x64
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

KozakMak wrote: 2025-04-22, 07:46 UTC and yes, auto adding to startup is evil
You can disable this in the settings: "App > auto startup"
KozakMak wrote: 2025-04-22, 07:46 UTC BUG. The menu appears in find people dialog in Active directory "Users and computers" console
Please send me a screenshot, I don't understand you.
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

KozakMak wrote: 2025-04-22, 07:46 UTC Error: Invalid option.
Specifically: x y
Gui,Show,"AutoSize x" WinX " y" WinY + 100,Menu settings
It can be fixed in different ways:
  1. Do not show the settings if the menu appeared in the wrong window (disable the settings button).
  2. Show the notification "The menu appeared in the wrong window" and don't display settings.
  3. Get the coordinates of the current (possibly incorrect window) and show the settings anyway.
  4. Do not show settings and warnings in case of an error.
Which one is better?
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

After testing, I had questions about the logic of the algorithm. Dear TC users, please help me.

The TC console does not open if QuickSwitch is not running as an administrator and TC is running as an administrator. How to fix this? In this case, the /i launch argument is being searched for.

The QuickSwitch handles the /i switch strangely. Please test if it picks up the configuration if TC is launched with /i config-name.ini (configuration must exist!)

If /i arg is not found, the required wincmd.ini path can't be found if:
  • config not in the current TC directory AND registry is empty.
  • config in the current directory, but it has the parameter UseIniInProgramDir < 4 AND the registry is empty.
What configuration should QuickSwitch use in this cases?..
User avatar
Dalai
Power Member
Power Member
Posts: 9943
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Dalai »

Rafaello wrote: 2025-04-22, 08:24 UTCThe TC console does not open if QuickSwitch is not running as an administrator and TC is running as an administrator. How to fix this?
You can't "fix" this as I said in my lengthy description how TC finds its config files. Windows doesn't allow sending messages, reading process command line and other things from lower privileged processes to ones running elevated. The only way to work around this is to launch your tool elevated (as admin) as well, but I recommend to leave that up to the user to decide. Programs running as admin can write to protected directories (Windows, Program Files, etc), so users need to trust your tool. And keep in mind that the UAC prompt will look different unless you sign your executable.
What configuration should QuickSwitch use in this cases?..
I repeat my suggestion: Ask the user to specify location of TC's configuration file. There can be multiple TC instances running simultaneously and each of them uses a separate config file, e.g. one relying on the registry location, the next is a portable one via UseIniInProgramDir and another one is started with /i switch. How you ask the user or design/implement the location's configuration is up to you.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Rafaello
Junior Member
Junior Member
Posts: 63
Joined: 2025-04-01, 17:48 UTC

Re: QuickSwitch and JumpToFolder AHK scripts

Post by *Rafaello »

Dalai wrote: 2025-04-22, 10:02 UTC Windows doesn't allow sending messages, reading process command line and other things from lower privileged processes to ones running elevated.
I'll probably add a warning about the need to run the QuickSwitch as admin for an accurate search. In this case, the algorithm will continue the search without starting the console...
Dalai wrote: 2025-04-22, 10:02 UTC I repeat my suggestion: Ask the user to specify location of TC's configuration file.
QuickSwitch works individually for each file manager instance. It'll be a problem to choose the configuration location separately for each instance each time. What if the user decides to change the configuration location for 3 TC instances (as I did during testing)? He will have to manually open the settings and specify something. This is one of the reasons why I want to fully automate the search algorithm.

Please look at another list of my questions, they are more solvable :)
Post Reply