It would be great if TC has "Macro Substitution" that can be used in COMMAND LINE, like it does in Midnight Commander (mc), for instance, which I often used in mc:
%s: selected files, %d: directory
%S: selected files in OTHER PANEL, %D: directory in OTHER PANEL
I created a few custom button bar in TC with that kind of parameters (mostly just %T, %P and %S -- it's getting very complicated now), maybe just enabled some of them for COMMAND LINE as well?
Macro Substitution (ALIAS to use Commands in TCs command line box)
Moderators: Hacker, petermad, Stefan2, white
Re: Macro Substitution
Hi and welcome.
See TOTALCMD.inc text file for internal commandos
example:
cm_SelectAllFiles=3302;Select all files
- - -
Under "Configuration > Options... > Misc." you can create an ALIAS for to use in TCs command line.
Alias: %s (or "ss")
Command: cm_SelectAllFiles
(use "magnifying glass" to search, and at the end also click the "check mark"-button)
Now type %s in TCs command line and press ENTER-key....
- - -
Alias: sf
Command: cm_SelectAllFolders
- - -
For "OTHER PANEL"
you can create a own user defined command
with "cm_FocusTrg=4006;Focus on target file list" (alternative for TAB-key)
in usercmd.ini like
[em_SelectAllFilesOnTarget]
cmd=cm_FocusTrg, cm_SelectAllFiles
and next use em_SelectAllFilesOnTarget as command for the alias.
or utilize
20.12.09 Added: SELECTFILES command supports modifiers (appended directly to command without space):
D=only folders, B=both, U=unselect, L=left side, R=right side, T=target panel,
S=Reverts whether just files or files+folders are selected when Shift is pressed during execution. (see History.txt)
Fine is, SELECTFILES will just select and doesn't switch focus.
For to use that command with parameter
create an user defined command in usercmd.ini first:
[em_SelectFilesT]
cmd=selectFilesT *
or
cmd=selectFilesT *.txt
use em_SelectFilesT as command for the alias (or in an button).
Alias seams not to respect the case, so using %s and %S is no option.
I just added for me an additional "t": sst , sft
Use Ctr+E to reuse last command in TCs command line or to cycle through the last commands.
ALT+F8 or Ctrl+ArrowDown (maybe two times) Opens the history list of the command line
Or hold Ctrl-key, press E and next ArrowDown.
See Menu "Help > Keyboard" for more...
See TOTALCMD.inc text file for internal commandos
example:
cm_SelectAllFiles=3302;Select all files
- - -
Under "Configuration > Options... > Misc." you can create an ALIAS for to use in TCs command line.
Alias: %s (or "ss")
Command: cm_SelectAllFiles
(use "magnifying glass" to search, and at the end also click the "check mark"-button)
Now type %s in TCs command line and press ENTER-key....
- - -
Alias: sf
Command: cm_SelectAllFolders
- - -
For "OTHER PANEL"
you can create a own user defined command
with "cm_FocusTrg=4006;Focus on target file list" (alternative for TAB-key)
in usercmd.ini like
[em_SelectAllFilesOnTarget]
cmd=cm_FocusTrg, cm_SelectAllFiles
and next use em_SelectAllFilesOnTarget as command for the alias.
or utilize
20.12.09 Added: SELECTFILES command supports modifiers (appended directly to command without space):
D=only folders, B=both, U=unselect, L=left side, R=right side, T=target panel,
S=Reverts whether just files or files+folders are selected when Shift is pressed during execution. (see History.txt)
Fine is, SELECTFILES will just select and doesn't switch focus.
For to use that command with parameter
create an user defined command in usercmd.ini first:
[em_SelectFilesT]
cmd=selectFilesT *
or
cmd=selectFilesT *.txt
use em_SelectFilesT as command for the alias (or in an button).
Alias seams not to respect the case, so using %s and %S is no option.
I just added for me an additional "t": sst , sft
Use Ctr+E to reuse last command in TCs command line or to cycle through the last commands.
ALT+F8 or Ctrl+ArrowDown (maybe two times) Opens the history list of the command line
Or hold Ctrl-key, press E and next ArrowDown.
See Menu "Help > Keyboard" for more...
Re: Macro Substitution (ALIAS to use Commands in TCs command line box)
Thanks for your verbose reply, very appreciated; particularly I found ALT-F8 is quite handy rather than repeatedly pressing CTRL-E.
I admit I never been utilizing ALIAS in misc. section, but what I meant by %s %d etc. in my post above is in order to use them as ARGUMENT/PARAMETER in TC' command bar, not as COMMAND/EXECUTABLE. Just exactly as it does with custom button/command. With custom button I can feed the ARGUMENT %S, %D, %T etc. Why can't I used them directly in the TC's COMMAND BAR/COMMAND LINE?
I admit I never been utilizing ALIAS in misc. section, but what I meant by %s %d etc. in my post above is in order to use them as ARGUMENT/PARAMETER in TC' command bar, not as COMMAND/EXECUTABLE. Just exactly as it does with custom button/command. With custom button I can feed the ARGUMENT %S, %D, %T etc. Why can't I used them directly in the TC's COMMAND BAR/COMMAND LINE?