Why TC does not support batch or script

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
welsn
New Member
New Member
Posts: 1
Joined: 2013-07-09, 01:30 UTC

Why TC does not support batch or script

Post by *welsn »

Why TC does not support batch or script, and when the new version is released?
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Why don't you provide more details regarding your question?
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

He's prolly referring to an internal scripting language - that would be able to access TC's commands directly w/o workarounds.

Many of the other alternative-file browsers have implemented a way for the user to issue multiple commands or basic looping/if/else logic in buttons or internal scripts.

Ghisler has traditionally been quite against implementing an internal script language, even though Lazarus has that built into the language.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50923
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm against it because it doesn't make much sense to give each program its own scripting language in a multi-tasking environment.
Author of Total Commander
https://www.ghisler.com
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

ghisler(Author) wrote:I'm against it because it doesn't make much sense to give each program its own scripting language in a multi-tasking environment.
But maybe you could provide better exchanging of parameters to work with other scripting language? Please.
gogis
Junior Member
Junior Member
Posts: 39
Joined: 2013-07-12, 07:45 UTC

Post by *gogis »

I am also voting for Scripting Language support of TC :D
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50923
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2Stefan2
Any suggestions about such an interface?
Author of Total Commander
https://www.ghisler.com
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

TC Scripting Support

Post by *Stefan2 »

ghisler(Author) wrote:2Stefan2
Any suggestions about such an interface?
Thanks for asking.




I know there are already some good ideas provided over the last years.

An dream perhaps would be a kind of ActiveX / COM dll to get access to every TC command :P from an scripting language.




But at least a kind of internal, easy and reliable SendMessage method would be useful to get and set TC information, maybe something like this:

TC_SendMessage.exe <TC-command> [ | affected pane: 1/2/a/i, default is 'a'] [ | Optional: parameter] [ | Optional: bWait, default is 'true'] [ | Optional: affected TC instance]


For example:

Code: Select all

TC_SendMessage.exe cm_CopyFullNamesToClip
TC_SendMessage.exe em_CreateNewFileWithDate | i 

Also a few additional commands would be useful to not abuse the clipboard always, e.g.:

cm_getPath | i
cm_FullNameList_TempFile | i | "filespec"
cm_SendKey "{F7}My New Folder{Enter}"

And also a few missing commands:
cm_CopyBASENamesToClip
cm_ConfirmBox "text"
cm_MessageBox "text"
cm_InputBox "text", "default"




That way, for simple actions no one has to use third party tools like AHK or AutoIt and every user has access to the same commands out of the box.
So we can point new users just to that executable to do some automations, instead to always sermonize to utilize AHK.
Would be an plus too for company users.


Perhaps, TC_SendMessage.exe could also execute a list of semicolon separated commands?
TC_SendMessage.exe cm_SelectAll ; cm_CopyFullNamesToClip
This is a often needed feature to use in buttons.


The provided information could be processed from every scripting language like VBS or Batch.

Examples:

Code: Select all

@ECHO OFF
for /f %%T in ('TC_SendMessage.exe cm_getPath | i ') do SET TCTarget=%%T
TC_SendMessage.exe cm_EditPath | i | "C:\Work 2013\Project x"
TC_SendMessage.exe cm_ConfirmBox
if %TC_Confirm%==0 EXIT

TC_SendMessage.exe cm_SelectAll | i 
TC_SendMessage.exe cm_FullNameList_TempFile | i | "C:\temp\myfilelist01.txt"
for /f %%f in ( "C:\temp\myfilelist01.txt") do echo %%f

Code: Select all

@ECHO OFF
TC_SendMessage.exe cm_OpenNewTab | i 
TC_SendMessage.exe cm_EditPath | i | "C:\Work 2013\Project x"
TC_SendMessage.exe cm_TrgSortByCol4

TC_SendMessage.exe cm_OpenNewTab
TC_SendMessage.exe cm_EditPath | a | "X:\Work 2000\Project zzz"
TC_SendMessage.exe cm_SrcSortByCol4


What do others think?
gogis
Junior Member
Junior Member
Posts: 39
Joined: 2013-07-12, 07:45 UTC

Post by *gogis »

Hi Stefan,
great ideas, I fully go in sync with your proposals.
In addition to those I also like "Capture-Replay" functionality that quickly provides a framework of commands that can be edited in a second step.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50923
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

There is already a SendMessage interface, via wm_copydata.
Author of Total Commander
https://www.ghisler.com
Post Reply