Opentabs & Ahk
Moderators: white, Hacker, petermad, Stefan2
Opentabs & Ahk
I am sure i am missing something here , but how can i use opentabs command in a Ahk script ?. Thanks.
Nope, opentabs doesn't have own number.
It's probably more like CD...
I found something like this...
Ok, it's not that hard, forget the line above
You send TC WM_COPYDATA.
COPYDATASTRUCT fields meaning:
lpData - string, a path to the directory
dwData - constant number, 'C'|( 'D'<<8 )...this is the critical thing. opentabs has more than 4 characters, so it won't fit in DWORD. Christian?
It's probably more like CD...
I found something like this...
Code: Select all
sendWM_COPYDATA('C'|('D'<<8),strcat(strcat(strcpy(t= malloc(strlen(argv[i+1])+strlen(argv[i+2])+2),argv[i+1]),"\r"),argv[i+2]),CharUpper(argv[i]+2));
You send TC WM_COPYDATA.
COPYDATASTRUCT fields meaning:
lpData - string, a path to the directory
dwData - constant number, 'C'|( 'D'<<8 )...this is the critical thing. opentabs has more than 4 characters, so it won't fit in DWORD. Christian?
I've found a workaround, it isn't perfect but it works.
Code: Select all
[User]
menu1=Load tabs
cmd1=opentabs
param1=C:\TOTALCMD\Tabs.tab
Code: Select all
PostMessage 1075, 701, , , ahk_class TTOTAL_CMD
2Christian
param1 doesn't work if %Commander_Path% is used.
2sas2000
In meanwhile, perhaps you could use:
Confirmed, you are right, even with double %.param1 doesn't work if %Commander_Path% is used.
In meanwhile, perhaps you could use:
Code: Select all
[User]
menu1=Load tabs
cmd1=OpenTabs %COMMANDER_PATH%\Tabs.tab
param1=<empty>
I can read English, but... I write like Tarzan. (sorry)
- ghisler(Author)
- Site Admin
- Posts: 48199
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2m^2
What you write is correct. The lpData value contains the first path, a line break, then the second path (or empty), terminated by a 0 character. After that, there can be optional parameters:
T means open in new tab
S means that the first parameter is passed to the source side and the second to the target instead of left and right.
What you write is correct. The lpData value contains the first path, a line break, then the second path (or empty), terminated by a 0 character. After that, there can be optional parameters:
T means open in new tab
S means that the first parameter is passed to the source side and the second to the target instead of left and right.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 48199
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Sorry, currently these cannot be used from the outside except for the described em_xyz command method.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
The only way to have %commander_path% interpreted with opentab is to use a user command :m^2 wrote:Thank you for the answer. Let me suggest it as a future upgrade.ghisler(Author) wrote:Sorry, currently these cannot be used from the outside except for the described em_xyz command method.
Code: Select all
[em_Lbar]
button=
cmd=OPENBAR
param=%A
the %A is mandatory !
It works fine from command line and from CopyData message But %P\%N as parameter only works from button...
For info this is a command i use in powerpro, it could be easily modified for ahk.
changBar.powerpro barname
Code: Select all
args barname
local bbThing = binary.from_ascii(?"em_lbar %commander_path%\bars"++barname++".bar")
local TC_CD = 0x4443
local TC_EM = 0x4D45
local TC_CM = 0x4D43
local TCHandle = win.handle("c=TTOTAL_CMD")
bbThing.sendcopydata( TCHandle,TC_EM))