[TC Tool] TC Script Editor

English support forum

Moderators: white, Hacker, petermad, Stefan2

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

Post by *Aezay »

Gregory wrote:2Aezay
I wonder if TC command <Go to file> (in Search) can be passed to TC by external program if it is so you can include it in TC Script
You mean like this?

Code: Select all

#define FileName "Readme.txt"
PostCmd(cm_ShowQuickSearch);
SendText(FileName);
The only problem is that there is no way to tell if a file named "Readme.txt" really exist, and a wrong file could get selected.
Also the SendText function is a little bugged since it sends ascii codes instead of virtual key codes.
Of all the planets I've been to, this one is my favorite.
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Post by *Gregory »

Not really like this. I meant the button Find files dialog - Go to file. Maybe there is a message in TC that doing the same.

I'm using cm_ShowQuickSearch in my scripts and there is another problem
if we have two files

readme.txt
and
readme1.txt

both of these files maybe found.
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

Pete wrote:If I have written several scripts already and I want to execute them, everytime I have to load them into TCScriptEditor first.
You can create a button or a start menu entry, set the command to TCScript.exe and the parameter to a .TCS file of your choice.

Gregory wrote:Not really like this. I meant the button Find files dialog - Go to file. Maybe there is a message in TC that doing the same.
This is not possible, at least not yet, but I guess that you could just send an Alt & G key press, that would active the button. Just remeber to use the PostCmd function to pass the command cm_SearchFor to TotalCmd, if you use SendCmd the script execution will be paused until the Find Files dialog is closed again.
Gregory wrote:I'm using cm_ShowQuickSearch in my scripts and there is another problem
if we have two files

readme.txt
and
readme1.txt

both of these files maybe found.
Yes, things are complicated when I can't get such info from TotalCmd. Maybe I could send the command cm_CopyNamesToClip and use the clipboard content to confirm whether or not the right file is selected.
Of all the planets I've been to, this one is my favorite.
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

Just wanted to say that v1.0 final has been released, look at my first post, enjoy :D
Of all the planets I've been to, this one is my favorite.
User avatar
Ergo
Senior Member
Senior Member
Posts: 204
Joined: 2003-02-05, 12:20 UTC
Location: Belarus
Contact:

Post by *Ergo »

:)
http://wincmd.ru/files/tcs_synplus.rar

Syntax highighting for this tool for SynPlus plugin
Wincmd.ru WWW.TOTALCMD.NET
I see that future is near...
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

I downloaded your script editor and gave it a try. I ran the Rename script. First, I renamed the file "Readme.txt' to 'foo'. Then I tried to rename it with its original name. However, I typed in 'Readme.txt' and the file was renamed 'readmetxt'.

I say you have some work to do. If text input isn't reliable, then that makes your tool less that useful, it makes it harmful!

The above was done with b94. I then tried to do it with b113. However, the Rename script fails with this build. I get the following error:

function "SendVKey"
Not Enough Parameters: 1, It Needs 2.

I thought perhaps you had changed the script, but no, they are identical in both builds.

Also, it would be helpful if you gave a description of your script commands. For instance, I have no idea what 'ifn' is. Or how to use 'if' for that matter.
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

Ergo wrote::)
http://wincmd.ru/files/tcs_synplus.rar

Syntax highighting for this tool for SynPlus plugin
How do I use this? I have SynPlus installed (and SynUS), but I don't know how to import this file.
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

robinsiebler wrote:I downloaded your script editor and gave it a try. I ran the Rename script. First, I renamed the file "Readme.txt' to 'foo'. Then I tried to rename it with its original name. However, I typed in 'Readme.txt' and the file was renamed 'readmetxt'.
I know of this bug, it happens beacuse ascii values are sent instead of virtual keys.
robinsiebler wrote:I say you have some work to do. If text input isn't reliable, then that makes your tool less that useful, it makes it harmful!
Did you miss the warning in my first message :D
robinsiebler wrote:The above was done with b94. I then tried to do it with b113. However, the Rename script fails with this build. I get the following error:

function "SendVKey"
Not Enough Parameters: 1, It Needs 2.

I thought perhaps you had changed the script, but no, they are identical in both builds.
Yes the new Script Library changed some functions:
- IntCmd renamed into HostCmd
- SendVKey now has a second parameter named state, set it to 2, and it will work as the last version.
robinsiebler wrote:Also, it would be helpful if you gave a description of your script commands. For instance, I have no idea what 'ifn' is. Or how to use 'if' for that matter.
v1.0 final includes a file named AzScript.txt which lists the parameters for each function.
Last edited by Aezay on 2003-12-15, 23:37 UTC, edited 1 time in total.
Of all the planets I've been to, this one is my favorite.
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

Aezay wrote:v1.0 final includes a file named AzScript.txt which lists the parameters for each function.

It lists the parameters. It doesn't tell you what each command does.
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

Aezay wrote:Yes the new Script Library changed some functions:
- IntCmd renamed into HostCmd
- SendVKey now has a second parameter named state, set it to 2, and it will work as the last version.
Perhaps you should update your sample scripts?
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

robinsiebler wrote:It lists the parameters. It doesn't tell you what each command does.
I see, well most of the functions have a name that makes them understandable. Some of the functions even has the same name as in other script/programming languages.

Note:
I've released a silent update, which fixes the script examples that I forgot to update.
Of all the planets I've been to, this one is my favorite.
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

Can you tell me what 'ifn' does? I did a google search and didn't get any programming related hits within the 1st 3 pages.
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

robinsiebler wrote:Can you tell me what 'ifn' does? I did a google search and didn't get any programming related hits within the 1st 3 pages.
if and ifn are temporary functions until I get a real if compare system written.

if will execute the next line if the variable Result equals the Compare parameter.
ifn will execute the next line if the variable Result doesn't equals the Compare parameter.
Of all the planets I've been to, this one is my favorite.
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2Aezay Wow! Very powerful language! But what do you think about extending it's power by some special commands for dialog box handling? ;) So it will be possible to write less harmful scripts like following

Code: Select all

PostCmd(cm_SearchFor);
IfDialogPresent("Find Files")
{
   SetText("Search for","*.mp3");
   SetText("Search in","d:\Music;e:\Download\Music");
   PushButton("Start search");
}
or

Code: Select all

PostCmd(cm_SearchFor);
IfDialogPresent("Find Files")
{
   SwitchToTab("Load/Save");
   SelectListItem("Previous searches","My Music");
   PushButton("Load");
   PushButton("Start search");
}
Raymond
Senior Member
Senior Member
Posts: 454
Joined: 2003-02-08, 15:43 UTC

Post by *Raymond »

@Aezay

This function:
SendVKey(VKey: int; State: int);
From the examples I know the second parameter can be 0, 1, 2. What do they stand for?
Post Reply