New parameter '%Selected' for repeated command execution
Posted: 2012-05-05, 18:47 UTC
I'd like to see a new magic parameter "%Selected" that can be used in the command line box (and possibly in button definitions?).
It would stand for "each file that is currently selected".
The magic is that when Total Commander sees this parameter in a command, it will automatically repeat that command for each file that is currently selected!
For example, if I have selected 5 files, and I type in the command line box: "Notepad %Selected", then Total Commander will pass this batch of commands to the OS:
[face=courier]Notepad <selected_file_1>
Notepad <selected_file_2>
Notepad <selected_file_3>
Notepad <selected_file_4>
Notepad <selected_file_5> [/face]
Additional related new parameters could be:
%SelectedStop%, where each command must complete and exit before the next is started;
%SelectedPath%, where not just the filename but its full path is passed, and
%SelectedPathStop% which combines the above.
(in the logfile, each commandline that was executed would have to be recorded individually, so you can check what you did wrong when things go awry
)
Of course, the actual name of this new parameter doesn't matter; '%X' would be just fine too.
P.S. a different but related idea: it would be nice if we could somehow use the button bar parameters (%N, %S, etc) in the command line box too. The benefit would be that you could repeat such commands for different files without having to edit the command line at all.
It would stand for "each file that is currently selected".
The magic is that when Total Commander sees this parameter in a command, it will automatically repeat that command for each file that is currently selected!

For example, if I have selected 5 files, and I type in the command line box: "Notepad %Selected", then Total Commander will pass this batch of commands to the OS:
[face=courier]Notepad <selected_file_1>
Notepad <selected_file_2>
Notepad <selected_file_3>
Notepad <selected_file_4>
Notepad <selected_file_5> [/face]
Additional related new parameters could be:
%SelectedStop%, where each command must complete and exit before the next is started;
%SelectedPath%, where not just the filename but its full path is passed, and
%SelectedPathStop% which combines the above.
(in the logfile, each commandline that was executed would have to be recorded individually, so you can check what you did wrong when things go awry

Of course, the actual name of this new parameter doesn't matter; '%X' would be just fine too.
P.S. a different but related idea: it would be nice if we could somehow use the button bar parameters (%N, %S, etc) in the command line box too. The benefit would be that you could repeat such commands for different files without having to edit the command line at all.