[TC Tool] TC Script Editor

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

[TC Tool] TC Script Editor

Post by *Aezay »

About this Program:
It all started with a program named TC Batch Script (which is dead now) which the lack of scripting in Total Commander made me create.
With this utility, you can execute multiple internal commands and use the scripts functions in other ways to interact with Total Commander.

Warning:
- Since this program uses Total Commander in a way it wasn't meant to be used, it could crash it!
- If you enter the right (or wrong) commands and run the script, you could delete files without seeing a confirmation dialog.
- Only use this tool if you swear not to blame me if something goes wrong (sounds comforting, right :P).

How To Use It:
First, copy the newest TOTALCMD.INC file into the same directory as the this executeable.

The script language is rather easy to learn, if you know another language, but it's currently limited in many ways. If you don't have any experience in scripting, then maybe this program isn't for you.

I wont go into details and descripe how each function in this script language works, instead open some of the included examples and study them carefully. A complete list of the functions can be found in the dialog that pops up when pressing F6.

There is 1 function I would like to explain though, and this is PostCmd which will send an internal command to TotalCmd such as cm_MkDir. By pressing F5, all internal commands will be listed in a dialog, where you also can filter them out.

I've also taken the liberty to include some scripts which has nothing to do with TotalCmd, just to show what other things this script engine can do.

Known Issues (Should be fixed, but please confirm):
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.

Command Line Parameteres:
TCScript.exe %filename% Loads the file into the script editor.
TCScript.exe /run %filename% Will run the script file and then quit.

05.05.16 / Released TC Script Editor v1.04 final - build 245:
> Direct Link (RAR) (237 k)
> Newest Script Library (Not available - Included in the direct link above)
> Screenshot (10.2 k)
> What's New (1984 b)
> Readme (1157 b)

> My TotalCmd Tools Dir
> List of All My Programs
Last edited by Aezay on 2005-05-16, 00:22 UTC, edited 21 times in total.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

2Aezay
Any example with big explanation, please :-)
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
Raymond
Senior Member
Senior Member
Posts: 454
Joined: 2003-02-08, 15:43 UTC

Post by *Raymond »

Seems the only way to run script is to press "Run Script" button. Could it be called with tcs file as command line parameter?
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

djk wrote:Any example with big explanation, please :-)
I know, the explanation is very limited. I included 2 or 3 examples, but they dont really show that much. I'll include some more in the next version.
Raymond wrote:Seems the only way to run script is to press "Run Script" button. Could it be called with tcs file as command line parameter?
Not yet, but it will be added.
Of all the planets I've been to, this one is my favorite.
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Hi Aezay

TCScript could be a great tool!

I notice that the Text function strips backslashes and other punctuation!

I was sending:

cd c:\afolder

The TC commandline received:

cdcafolder
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

I love you Aezay!!!!

My biggest wish for TC ( http://www.ghisler.ch/board/viewtopic.php?t=119 ) is finally taking form even with an add-on application!!!

Now we are able to automate a series of file managing actions performed by the very best file manager ever created!!!

Wow, these are happy days!!! Keep up the good work!

Regards,
Panos
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3881
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Great tool !

The very first step is done.

Now it's up to Christian to give a little support concerning "remote control" running stable.

May be it is possible to support parameters along with certain internal commands.
Try 'n' error is quite dangerous for this.
#5767 Personal license
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Post by *Gregory »

2Aezay
I'm using Windows PowerPro for writing scripts for TC (it can invoke internal commands of TC), but your program is very interesting too (and eazier a lot). Good work!
Now it's up to Christian to give a little support concerning "remote control" running stable.
And find the way to pass information about TC (active panel, sorting order, files in active and target panels, state of branch view etc.) to external programs like TC Batch Script
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

Gregory wrote:And find the way to pass information about TC (active panel, sorting order, files in active and target panels, state of branch view etc.) to external programs like TC Batch Script
This is really the only thing missing, before a 3rd party script program can be complete.

Also, I've released beta2 which works a little better.
Of all the planets I've been to, this one is my favorite.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

2Aezay
Well, now I see how it works. Great tool!
My first batches which I prepared were to easily change TC language - I couldn't find such an option in TC.
Aezay wrote:
Raymond wrote:Seems the only way to run script is to press "Run Script" button. Could it be called with tcs file as command line parameter?
Not yet, but it will be added.
It seems to be already added.

2 whishes:
- I couldn't find an option to insert a command between existing ones, it's always added at the end of them. Could it be possible to add such option? Or possiblity to move the commands up/down?
- There is an option "Save" but it always ask for a name of the script (even I loaded one). Could you add "Save as" for such behaviour and "Save" change for saving current batch.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
TucknDar
Senior Member
Senior Member
Posts: 227
Joined: 2003-02-07, 09:44 UTC
Location: Oslo
Contact:

Post by *TucknDar »

This is a great addition to TC! Thanks a lot!

I'm looking forward to this maturing a little, so TC-tasks can be made even easier :)
license #76904
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

I've scrapped the project :o


Don't worry, I started another project entirely from scratch, here's a little preview on how it looks at the moment.

It may look more complicated, but it's much easier to edit and more similar to a real script language. It uses a modified script library I've created for my application Nifty Worker v2.0, which is currently in the beta stages.
Last edited by Aezay on 2004-06-14, 04:55 UTC, edited 1 time in total.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

Looks nice - so we are waiting :-)
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

And maybe a few of you programming gurus could post some sample files made from this that would help up non-programmers get full use out of this great program? :)
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2Aezay Congratulation! Great tool.
Long time i intended to write scripting tool, but you are first. :)
What do yoou think about implementing this tool as FS-plugin? Avantages are:
1. If several TC instances are running you don't need to find the correct one.
2. If you run script in the same thread as TC it is more safely, from user input point of view, because user input is blocked.
Post Reply