Please DON'T do that! It may hang the installer when trying to install newer TC versions from outside of TC..."InstallDir"="%COMMANDER_PATH%"
[TC Tool] TC Script Editor
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Hi,
i'm just trying out TC Script and have some questions. Is it possible to copy date of the day into clipboard to make a directory with it or can i make directories like 1, and if 1 exits it will make a directory 2 and so on with a command in TC to use in TC Script?
I searched in the forum but found nothing to help me.
Thx for answer
i'm just trying out TC Script and have some questions. Is it possible to copy date of the day into clipboard to make a directory with it or can i make directories like 1, and if 1 exits it will make a directory 2 and so on with a command in TC to use in TC Script?
I searched in the forum but found nothing to help me.
Thx for answer
Gruss
Tequilla
Tequilla
I've created a script to start Total Commander and pop up search dialog box (to search root drive by default):
#include VKeys.h
#define VK_F 70
//define the corresponding 'letter' !!
Exec(TotalCmdExe,"/N");
sleep(500);
//Find TotalCmd's Window handles using our hosts command #0
HostCmd(0);
sleep(500);
PostCmd(cm_SearchFor);
//Search in all drives
SendVKey(VK_TAB,2);
SendVKey(VK_TAB,2);
SendVKey(VK_RETURN,2);
SendVKey(VK_RETURN,2);
//Activate the search field
SendVKey(VK_MENU,1);
SendVKey(VK_F,2);
SendVKey(VK_MENU,0);
It works fine if there is an instance of Total Commander ranning already. But it does not work if Total Commander is not running (e.g. if I'm starting this script by a shortcut from Aston desktop).
What could be the problem?
#include VKeys.h
#define VK_F 70
//define the corresponding 'letter' !!
Exec(TotalCmdExe,"/N");
sleep(500);
//Find TotalCmd's Window handles using our hosts command #0
HostCmd(0);
sleep(500);
PostCmd(cm_SearchFor);
//Search in all drives
SendVKey(VK_TAB,2);
SendVKey(VK_TAB,2);
SendVKey(VK_RETURN,2);
SendVKey(VK_RETURN,2);
//Activate the search field
SendVKey(VK_MENU,1);
SendVKey(VK_F,2);
SendVKey(VK_MENU,0);
It works fine if there is an instance of Total Commander ranning already. But it does not work if Total Commander is not running (e.g. if I'm starting this script by a shortcut from Aston desktop).
What could be the problem?
I would recommend to use AutoHotkey instead. It is mighty and more easy to use. And there are already a lot of scipts for TC to use or to learn how to create others.
There is also a tool to convert the scripts to exe-files. THus you don't need to have AutoHotkey installed to run those scripts.
sheepdog
There is also a tool to convert the scripts to exe-files. THus you don't need to have AutoHotkey installed to run those scripts.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
This can be done by this script:
As I mentioned, you can compile this script to an Exe file, if you want. Then it's not necessary to have AHK installed.
sheepdog
[edit]
You may navigate in the searchwindow by sending keystrokes e.g.
send, {Tab} c:\+{Tab}
to put in search in: c:\
and return to the search for field
while '+' is the modifier for shift (to send actually '+' you would have to use the sendraw command)
But that you could find in the detailed help
[/edit]
Code: Select all
;TC Search
; adapt the path to Total Commander in the line that begins with 'run'
; YOu don't have to use Quotation marks, even if there is a space in the path name
ifwinexist ahk_class TTOTAL_CMD ; is there already a Instance of TC?
{
IfWinExist ahk_class TFindFile ; is still the searchwindow open ?
{
winactivate ahk_class TFindFile ; if yes activate
return ; and ready
}
else
{
Winactivate ahk_class TTOTAL_CMD ; if TC is open but no search window activate TC window
WinWaitActive ahk_class TTOTAL_CMD ; Wait till it's active
PostMessage, 1075, 501, , , ahk_class TTOTAL_CMD ; Send cm_searchfor
}
}
else
{
run, totalcmd, c:\total Commander ; run totalcmd
Winactivate ahk_class TTOTAL_CMD ;activate TC
WinWaitActive ahk_class TTOTAL_CMD ; and wait till it's active
PostMessage, 1075, 501, , , ahk_class TTOTAL_CMD ; send 'cm_SearchFor'
}
return
sheepdog
[edit]
You may navigate in the searchwindow by sending keystrokes e.g.
send, {Tab} c:\+{Tab}
to put in search in: c:\
and return to the search for field
while '+' is the modifier for shift (to send actually '+' you would have to use the sendraw command)
But that you could find in the detailed help
[/edit]
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
If you look at my script you can see it already.
It's the line with
PostMessage, 1075, 501, , , ahk_class TTOTAL_CMD ; Send cm_searchfor
where you send the command number you'll find in totalcmd.inc file. But if you are interested have a look at the TCWiki page . There you can find even a script that sends any command to TC
sheepdog
It's the line with
PostMessage, 1075, 501, , , ahk_class TTOTAL_CMD ; Send cm_searchfor
where you send the command number you'll find in totalcmd.inc file. But if you are interested have a look at the TCWiki page . There you can find even a script that sends any command to TC
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
You can download the Zipped Version of Autohotkey if you dont like to install it. It contains the ahk2exe file that you need to compile the script (as Raymond already stated).
sheepdog
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams