multiple commands in one button
Moderators: Hacker, petermad, Stefan2, white
multiple commands in one button
Hi,
I am newbie to TC. I wonder how do make the following in one button:
cm_opennewtab
cd c:/windows
Thanks
I am newbie to TC. I wonder how do make the following in one button:
cm_opennewtab
cd c:/windows
Thanks
hi sammy
AFAIK, this is not possible right now, because you can not use TC-internal commands in a batch, and the choice of a start-path has no effect to internal commands - as in the help defined.
If anyone has got a workaround for this problem: I would be interested, too!
The only one, I can give: Create 2 buttons: one for the new tab, the other one to change to C:/Windows. Not very smart, I must admit
Best regards,
Marc
AFAIK, this is not possible right now, because you can not use TC-internal commands in a batch, and the choice of a start-path has no effect to internal commands - as in the help defined.
If anyone has got a workaround for this problem: I would be interested, too!

The only one, I can give: Create 2 buttons: one for the new tab, the other one to change to C:/Windows. Not very smart, I must admit

Best regards,
Marc
Well, the easy way would be:
1. Make sure you have only one Tab open in the curent panel and that it points to C:\Windows
2. Right-click on the tab-header (you need to have Configuration - Options - Folder Tabs - Show tab header also when there is only one tab enabled for this step) and select Save tabs to file
3. Save the file
4. Add a new button o the Button Bar with the command APPENDTABS <tabfile.tab> where <tabfile.tab> is the file you saved the tab into.
Now you should only need to click that button and a new tab with C:\Windows should open.
The difficult way would be to use Aezay's TC Script Editor, which you can search for on this forum ("script editor").
HTH
Roman
1. Make sure you have only one Tab open in the curent panel and that it points to C:\Windows
2. Right-click on the tab-header (you need to have Configuration - Options - Folder Tabs - Show tab header also when there is only one tab enabled for this step) and select Save tabs to file
3. Save the file
4. Add a new button o the Button Bar with the command APPENDTABS <tabfile.tab> where <tabfile.tab> is the file you saved the tab into.
Now you should only need to click that button and a new tab with C:\Windows should open.
The difficult way would be to use Aezay's TC Script Editor, which you can search for on this forum ("script editor").
HTH
Roman
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
Nice trick. Thanks.Hacker wrote:Well, the easy way would be:
1. Make sure you have only one Tab open in the curent panel and that it points to C:\Windows
2. Right-click on the tab-header (you need to have Configuration - Options - Folder Tabs - Show tab header also when there is only one tab enabled for this step) and select Save tabs to file
3. Save the file
4. Add a new button o the Button Bar with the command APPENDTABS <tabfile.tab> where <tabfile.tab> is the file you saved the tab into.
HTH
Roman
However, it doesn't activate the new tab.
- franck8244
- Power Member
- Posts: 704
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...
It works with TCScript Editor 
Just read the code for explanation:
To open any directory, you can replace part of the code (between the "cd" command and the return instruction).
Example with "c:/windows/"
I hope it will help...

Just read the code for explanation:
Code: Select all
//Open a new tab in %WINDIR%
#include VKeys.h
//SendVKey(VK_TAB,2) Uncomment to open the tab in the other panel
Sendcmd(cm_OpenNewTab);
//Activate or Focus the cmd line
SendVKey(VK_LSHIFT,1);
SendVKey(VK_LEFT,2);
SendVKey(VK_LSHIFT,0);
SendText("cd ");
//Emulate the "%"
SendVKey(VK_MENU,1);
SendVKey(VK_NUMPAD3,2);
SendVKey(VK_NUMPAD7,2);
SendVKey(VK_MENU,0);
SendText("WINDIR");
//Emulate the "%"
SendVKey(VK_MENU,1);
SendVKey(VK_NUMPAD3,2);
SendVKey(VK_NUMPAD7,2);
SendVKey(VK_MENU,0);
SendVKey(VK_RETURN,2); //Validate :)
/*Uncomment the whole bloc if you don't want focus on the new
tab but the previous one
SendVKey(VK_LCONTROL,1);
SendVKey(VK_TAB,2);
SendVKey(VK_LCONTROL,0);*/

Example with "c:/windows/"
Code: Select all
SendText("C");
//Emulate the ":"
SendVKey(VK_MENU,1);
SendVKey(VK_NUMPAD5,2);
SendVKey(VK_NUMPAD8,2);
SendVKey(VK_MENU,0);
SendVKey(VK_DIVIDE,2); // "/"
SendText("WINDOWS");
SendVKey(VK_DIVIDE,2);
TC#88260 -
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
- franck8244
- Power Member
- Posts: 704
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...
2Sanskritfritz
That gave me the idea to try the ascii code combine with the "Alt" key (corresponding to the VK_MENU)...
I also looked for those and I "found" :i looked for the virtual key for colon and backslash
Code: Select all
//VK_0 thru VK_9 are the same as ASCII '0' thru '9' ($30 - $39)
//VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' ($41 - $5A)
TC#88260 -
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
SanskritFritz,
klark,
sammy,
Roman
Well, that's why se use SendVKey...I tried it, but the SendText being buggy, i could not get it to work.
klark,
Anytime.That is cool. I didn't know this command. Thanks!
sammy,
Sorry, didn't test it.However, it doesn't activate the new tab.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
SanskritFritz wrote:I tried it, but the SendText being buggy, i could not get it to work. Even using the Directory Menu it didnt work
I feel kind of bad about not really working on this tool anymore, but if someone knows the API function to do this convertion, please let me know and ill update the tool so SendText could be fixed.Aezay wrote:Known Issues:
The SendText command does not work with special characters, only lowercase letters a to b and numbers 0 to 9. This shouldn't be to difficult to fix, I just need to put it through an ASCII -> Virtual Key converter. If I'm not mistaken, theres an API funtion for this, but i cant remember the name of it.
- pdavit
- Power Member
- Posts: 1529
- Joined: 2003-02-05, 21:41 UTC
- Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
- Contact:
Long time no see Aezay!Aezay wrote:I feel kind of bad about not really working on this tool anymore, but if someone knows the API function to do this convertion, please let me know and ill update the tool so SendText could be fixed.
You really shouldn't feel bad since you have given us one of the best tools around which is also my biggest wish
for an internal feature for TC.
Anyway, your interest might grow again with the release of v6.50 of TC which might need to introduce some new
commands for TCScriptEditor.
Take good care,
Panos
PS: Sorry for being OT...

"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
Christian Ghisler Rules!!!
Perhaps MapVirtualKey is what you are referring to? It can convert keyboard scan codes to virtual key codes, and vice versa.Aezay wrote:If I'm not mistaken, theres an API funtion for this, but i cant remember the name of it.
Thanks, ill take a look at itBoah wrote:Perhaps MapVirtualKey is what you are referring to? It can convert keyboard scan codes to virtual key codes, and vice versa.Aezay wrote:If I'm not mistaken, theres an API funtion for this, but i cant remember the name of it.
