Page 1 of 1

Total Commander 7.55ß - %S parameter in Button Bar / Menu

Posted: 2010-04-13, 06:45 UTC
by Akira
According to help file %S parameter denotes selected files as parameters when launching through buttonbar or menu. When I launch VLC for instance through the buttonbar giving %S parameter the program receives parameters even when nothing is selected in the panels.
It would be better having %S empty in case nothing is selected.
Regs - Akira

Posted: 2010-04-13, 07:05 UTC
by MVV
Even if no files selected you have the focused one - and it is the selected one (all operations take focused file if no selected files). You should put focus onto ".." item if you don't want to pass focused file to program.

Posted: 2010-04-14, 08:10 UTC
by Akira
I agree that it is now like you describe it.
Simply if I want to use focussed file I can use %N parameter as described in help file.
Or I can use %N %S if I want to pass the selected and the focussed file to the program. In this case the program receives twice the same parameter if the focussed file is the same as the selected file.
There is no obvious reason to me why selected file %S defaults to focussed %N when nothing is selected in the active panel.
It is rather annoying since I can't launch a program by itself and I always must take care of what is focussed before launching a program. No way to launch with only selected stuff as described in the help file. Unless there is a parameter I am not aware of which can do this.

Posted: 2010-04-14, 08:30 UTC
by MVV
For now I may suggest only one thing - you may add ? characher before command line parameters in button's properties - so TC will ask you for params when you click button. And, if you wish to start program w/o params, just press Delete to erase text and then Enter to start program w/o params.

Posted: 2010-04-14, 16:06 UTC
by ghisler(Author)
Indeed it's not a bug, %S will pass the files which are handled in functions like F5 copy or F8 delete.

Posted: 2010-04-19, 09:16 UTC
by Akira
It makes sense for copy & delete. Its not a bug, its a feature.
Maybe one of the moderators can shift the whole thing to the feature request section please.
I would like to propose to have a new %<what-ever-letter> which is like %S but empty if nothing is selected in the active panel.
The workarounds are ok but I am simply too lazy to start thinking about what I have to focus, click or not before launching a program. I'm gonna try to check an external cmd handler to see if this can do the job.

Posted: 2010-04-19, 09:53 UTC
by MVV
Maybe you may append some prefix to %S so it will hurt first parameter so your player will need to skip it? E.g.:

Code: Select all

/xxx%S
(first filename will get prefix /xxx)

Posted: 2010-04-19, 10:01 UTC
by Hacker
[mod]Moved to the TC 7.55 Suggestions forum.

Hacker (Moderator)[/mod]