Page 1 of 1

Support executing commands with parameters as EM-commands via WM_COPYDATA

Posted: 2019-11-05, 07:53 UTC
by MVV
TC has different kinds of commands:
1. Numbered CM-commands w/o parameters. May be executed either via WM_USER + 51 message or via WM_COPYDATA as EM-commands.
2. Named EM-commands. May be executed via WM_COPYDATA with "EM" data tag.
3. Named commands with parameters (like OPENTABS, CD, OPENBAR, LOADSEARCH in separate group of command browser). May not be executed neither via WM_USER + 51 nor via WM_COPYDATA message (*).
4. Numbered CM-commands that support optional parameter string. May be executed via WM_USER + 51 message with numeric parameter, or via WM_COPYDATA as EM-commands with any parameter.

* Most named commands may be executed via a wrapper EM-command with %A parameter, like em_MultiRename with MULTIRENAME command and %A parameter, or em_OpenTabs with OPENTABS command and %A parameter and even (surprisingly) em_PanelWidth command with cm_100percent command and %A (it really accepts %A parameter though TC interface blocks parameter field for any CM-command so manual usercmd.ini editing is needed). This way is not usable because it requires a wrapper command for every command with parameter.

Please make parametrized commands working in TC 9.50 just via WM_COPYDATA with "EM" data tag call, i.e. process them like EM-commands, it should be quite easy to fix since TC already has a code that parses buttonbar commands. It isn't portable and useful to create a wrapper command per every command with parameters.

Some examples of executing commands via TCFS2:

Code: Select all

TCFS2.exe /ef tem(`em_OpenTabs D:\1.tab`)
TCFS2.exe /ef tem(`em_OpenBar D:\1.bar`)
TCFS2.exe /ef tem(`em_MultiRename MyTemplate`)
TCFS2.exe /ef tem(`em_SelectFiles *.ini`)
TCFS2.exe /ef tem(`em_PanelWidth 88`)
TCFS2.exe /ef tem(`cm_100percent 88`)
TCFS2.exe /ef tem(`cm_GoToFirstFile 10`)

It would be much easier to be able to execute such commands directly (currently not possible)!

Code: Select all

TCFS2.exe /ef tem(`OPENTABS D:\1.tab`)
TCFS2.exe /ef tem(`OPENBAR D:\1.bar`)
TCFS2.exe /ef tem(`MULTIRENAME MyTemplate`)
TCFS2.exe /ef tem(`SELECTFILES *.ini`)
PS. Perhaps it would also be nice not to block parameter field for commands that may have parameters because there are such CM-commands (cm_Wait, cm_Select, cm_Reverse, cm_GoToFirstFile, cm_SrcViewModeList, cm_LeftViewModeList, cm_RightViewModeList, cm_100percent, cm_VerticalPanels, cm_*ByName etc).

Re: Support executing commands with parameters as EM-commands via WM_COPYDATA

Posted: 2019-11-06, 07:18 UTC
by dindog
I would be nice to have, also should allow parameters for multi command like: cd c:\,cm_wait 500,cm_select 1000, it's impossible to have this sequence command without help of outside tools like tcfs2

Re: Support executing commands with parameters as EM-commands via WM_COPYDATA

Posted: 2019-11-06, 10:33 UTC
by MVV
Multi-commands is a separate feature that is quite limited due to a command separator that may appear in a command parameter... It needs some way to enclose parameters in order to allow them.