[TC Tool] TC Script Editor

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

Here's another TCScript Editor example:

http://www.ghisler.ch/board/viewtopic.php?t=5548
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
Alya
Junior Member
Junior Member
Posts: 58
Joined: 2005-01-19, 02:41 UTC

Post by *Alya »

I'd like TotalCommander to always have focus on right panel when it opens. Presently by default it opens with focus on left panel.

I created the following script with TCscript.exe:

PostCmd(cm_focusright);

How can I make this script execute every time TC starts?
User avatar
franck8244
Power Member
Power Member
Posts: 703
Joined: 2003-03-06, 17:37 UTC
Location: Geneva...

Post by *franck8244 »

You do not need TCSCript Editor fot that !

Look at the help file section 4.a : command line parameters...

You can use the /R switch ...
TC#88260 -
User avatar
sas2000
Power Member
Power Member
Posts: 682
Joined: 2003-02-07, 04:32 UTC
Location: Galiza

Post by *sas2000 »

 
  2Alya:

You can add this line to Wincmd.ini :
ActiveRight=1

From TC Help:
ActiveRight=0          1: The right listbox will be active when Total Commander starts (1/0)
 
 
Alya
Junior Member
Junior Member
Posts: 58
Joined: 2005-01-19, 02:41 UTC

Post by *Alya »

Thank you :)
ActiveRight=1 worked.
(/R switch I was already using - it opened desired directory on the right, but focus was still on the left)...
User avatar
franck8244
Power Member
Power Member
Posts: 703
Joined: 2003-03-06, 17:37 UTC
Location: Geneva...

Post by *franck8244 »

2Aezay
Can you implement an internal string_replace function in TCSCript ?

It could take 5 parameters : str_dest, str_src, str_Search, str_ReplaceWith, int_IgnoreCase

Thanks in advance
TC#88260 -
Alya
Junior Member
Junior Member
Posts: 58
Joined: 2005-01-19, 02:41 UTC

Post by *Alya »

I'm trying to get the tree view in the left panel open at the same folder that's opened in right panel. (discussed at length here: http://www.ghisler.ch/board/viewtopic.php?t=6134)

I created the following script:

PostCmd(cm_LeftTree);

How can I make this script execute every time I launch a new instance of Total Commander?
User avatar
franck8244
Power Member
Power Member
Posts: 703
Joined: 2003-03-06, 17:37 UTC
Location: Geneva...

Post by *franck8244 »

How can I make this script execute every time I launch a new instance of Total Commander?
You will have to launch TC by using a script !

for example call :

Code: Select all

"C:\Program Files\totalcmd\Utils\Macro\TCScript.exe" /run "C:\Program Files\totalcmd\Utils\Macro\a.tcs"
Where a.tcs contains the following code:

Code: Select all

Exec(TotalCmdExe,"/N");
sleep(250);
//Find TotalCmd's Window handles using our hosts command #0
HostCmd(0);
sleep(250);
PostCmd(cm_LeftTree);
TC#88260 -
Alya
Junior Member
Junior Member
Posts: 58
Joined: 2005-01-19, 02:41 UTC

Post by *Alya »

franck8244 - thanks.

There are two issues:
1. Total Commander starts, but doesn't execute "cm_LeftTree". I also tried other variations (just to test it)- same problem. E.g.:

Exec(TotalCmdExe,"/N");
sleep(250);
HostCmd(0);
sleep(250);
PostCmd(cm_OpenDesktop);

does NOT open Desktop folder, and so on...

2. How can I pass a folder that I wish to open as a parameter to the script? Something equivalent to:
[path to totalcmd.exe]\totalcmd.exe /R="%1"
Where "%1" is the folder that was clicked to launch Total Commander
User avatar
franck8244
Power Member
Power Member
Posts: 703
Joined: 2003-03-06, 17:37 UTC
Location: Geneva...

Post by *franck8244 »

Alya wrote: Total Commander starts, but doesn't execute "cm_LeftTree". I also tried other variations (just to test it)- same problem.
It works for me :(
Alya wrote:How can I pass a folder that I wish to open as a parameter to the script? Something equivalent to:
[path to totalcmd.exe]\totalcmd.exe /R="%1"
Where "%1" is the folder that was clicked to launch Total Commander
You can not do that ... except if you have a way to put the foder path in the clipboard....

Why don't you simply close TC while in Tree view in the left ?
Then when you open it, it will be again in tree view ...
TC#88260 -
Alya
Junior Member
Junior Member
Posts: 58
Joined: 2005-01-19, 02:41 UTC

Post by *Alya »

franck8244
Why don't you simply close TC while in Tree view in the left ?
Then when you open it, it will be again in tree view ...
I'm already doing that. I have tree view on the left - but it doesn't correspond to folder opened on the right.
E.g. folder F:\eBooks\Computers\ opened in right panel, tree view of C:\ opened in left panel.

I configured all folders to open by default in Total Commander through Folder Options (more detailed description here http://www.ghisler.ch/board/viewtopic.php?t=6134). The parameters are passed automatically by Windows - I 'm not sure how one can involve Clipboard here....

This is becoming complicated... :( There should be a simpler way to make Total Commander execute one of its' own internal commands on start-up! This is such a basic feature...
Alya
Junior Member
Junior Member
Posts: 58
Joined: 2005-01-19, 02:41 UTC

Post by *Alya »

Whenever I run TC Script Editor it says "Total Commander executable could not be found" and all the scripts don't run for this reason

But TCScript.ini clearly specifies path to executable C:\Progra~1\Totalcmd\Totalcmd.exe
User avatar
franck8244
Power Member
Power Member
Posts: 703
Joined: 2003-03-06, 17:37 UTC
Location: Geneva...

Post by *franck8244 »

2Alya

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Ghisler\Total Commander]
"InstallDir"="%COMMANDER_PATH%"
save this into a *.reg file and "launch it" ... this should solve your problem
TC#88260 -
Raymond
Senior Member
Senior Member
Posts: 454
Joined: 2003-02-08, 15:43 UTC

Post by *Raymond »

franck8244 wrote:2Alya

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Ghisler\Total Commander]
"InstallDir"="%COMMANDER_PATH%"
save this into a *.reg file and "launch it" ... this should solve your problem
It will be great if next version of TC Script Editor could support "UseIniInProgramDir=7
" feature of TC 6.5.
Alya
Junior Member
Junior Member
Posts: 58
Joined: 2005-01-19, 02:41 UTC

Post by *Alya »

franck8244

Thank you - that solved the problem :)
Post Reply