Why TC does not support batch or script
Moderators: Hacker, petermad, Stefan2, white
Why TC does not support batch or script
Why TC does not support batch or script, and when the new version is released?
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
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.
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.
- ghisler(Author)
- Site Admin
- Posts: 50923
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50923
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
TC Scripting Support
Thanks for asking.ghisler(Author) wrote:2Stefan2
Any suggestions about such an interface?
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

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?
- ghisler(Author)
- Site Admin
- Posts: 50923
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
There is already a SendMessage interface, via wm_copydata.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com