AHK script as Total Commander button

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

AHK script as Total Commander button

30 Apr 2024, 16:19

Hello,

I put an AHK script inside of the Total Commander (TC) button bar.
Additionally, I added the path to the AHK compiler, so it looks like this (simplified):
"C:\AutoHotkeyU64.exe" C:\myscript.ahk

This is the AHK example script:

Code: Select all

for n, param in A_Args  ; For each parameter:
{
    MsgBox Parameter number %n% is %param%.
}
The problem:
When I drag multiple files inside of this button, it only shows the first file.

I also tried different things like putting extra parameters inside of the TC button:
"C:\AutoHotkeyU64.exe" C:\myscript.ahk %P\%N

My wish is that I perform some action for multiple files at once.
Right now, it would only work for 1 file...

Thanks for any help and best regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
mikeyww
Posts: 28989
Joined: 09 Sep 2014, 18:38

Re: AHK script as Total Commander button

30 Apr 2024, 16:40

I tried adding a new command to the TC Start Menu. It worked.

TOTALCMD64.EXE240430-1738-001_cr.png
TC Start Menu
TOTALCMD64.EXE240430-1738-001_cr.png (13.36 KiB) Viewed 509 times
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: AHK script as Total Commander button

06 May 2024, 03:53

Hi and thanks for your answer.

After multiple tries it finally worked.
Either when the ahk script is in command or parameter.
Also with %P%S, but even without this parameter.

The import thing is that you don't drag the files into the button but just mark them and click the button.
That's really confusing in my opinion.

Also, by default there is always at least one marked/selected item in TC, so AHK would always show this one as parameter.

But looks it's not an AHK related problem anymore...

Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ByronicZero, Google [Bot], leothlon and 116 guests