Page 1 of 1

[Implemented] Option to modify %S and %R parameters

Posted: 2009-09-25, 09:11 UTC
by petermad
As it is now, %S or %R used as a parameter in for example a button, always passes at least one file, even if no files are selected. If no files are selected the name of the file under the cursor is curently passed (equivalent to %N or %M).

It could be usefull with a switch %Y (like the %X switch) that would make the following instances of %S and %R be applied to ONLY truely selected files - hence returning an empty string if no files are selected.

The help for such a switch could look like this:
%Y Parses the empty string for the following parameters after this parameter, if no files are actively selected:
%S, %s, %R, %r

%y Parses again the name of the file under the cursor, if no files are selected.
That should make a command like totalcmd.exe /S=C %Z %T%S1 %Y%T%R1 %y%P%S2 work like cm_CompareFilesByContent


This switch could even be expanded to also work for %L, %l, %F, %f, %D, %d, %WL, %WF, %UL and %UF parsing the empty string instead of the name of the temporary list file, when no files are selected :!:

That would make a command like totalcmd.exe /S=S %Z%X "%P" "%T" /O=%Y%L work as cm_FileSync also when no files are selected.

Posted: 2009-09-25, 13:06 UTC
by Boofo
Support++

Posted: 2009-09-25, 14:44 UTC
by Balderstrom
The file under the cursor is considered Selected for every TC command, the File just isn't displayed as "hilighted|inverted". It is similiar to most(?) File manager's -- even explorer.

It's possible it's even considered selected internally by windows. As indicated by this AHK line:
--> ControlGet, OutputVar, Choice, , TMyListBox2
Choice: Sets OutputVar to be the name of the currently selected entry in a ListBox or ComboBox.
If no files are manually Selected (Ctrl+Click, Shift+Click, etc etc) the above OutputVar is always minimally where the cursor is in TC.

Try this as well, place the cursor on a file, Press Ctrl+Click on another file.
Both files are now selected. Even though you didn't Ctrl+Click on the first file.

Posted: 2009-09-25, 19:44 UTC
by petermad
The file under the cursor is considered Selected for every TC command, the File just isn't displayed as "hilighted|inverted". It is similiar to most(?) File manager's -- even explorer.
NO - if other files are selected but the one under the cursor isn't, then the one under the cursor is NOT considered selected - hence not deleted for example if I choose to delete selected files!

Anyway - I am not asking for an explanation of the current behaviour - I am asking for a way to modify it.

Posted: 2009-09-25, 19:54 UTC
by Balderstrom
If it's possible, then probably: %U%S

I was just stating, I don't know if it's possible, as the file under the cursor is considered selected -- except when their are other manually selected files.

Posted: 2017-09-30, 03:32 UTC
by petermad
Bump*

To Ghisler - maybe this could reach TC 9.10:

Please consider a way to not consider the file under the cursor as selected if no other files are selected when using the parameters: %S and %R an preferably also for %L, %l, %F, %f, %D, %d, %WL, %WF, %UL and %UF.

The way it is suggested in the first post, will not break any backward comptability.

Posted: 2017-10-01, 07:58 UTC
by ghisler(Author)
Sorry, TC 9.10 is now feature-complete, because I absolutely have to release it before October 17, when Windows 10 Fall Creators Update will be released.

Posted: 2017-10-01, 09:49 UTC
by petermad
OK - but maybe for the next TC release?

Posted: 2017-10-02, 08:23 UTC
by ghisler(Author)
OK, I will add it to my todo list.

Posted: 2017-10-02, 08:58 UTC
by MVV
I would add rather a modifier for parameter than a switch... Just like W or U modifier for %L... E.g. %YR1 or %YS1.

Posted: 2018-05-05, 01:54 UTC
by petermad
History.txt
04.04.18 Added: New button bar parameter %Y anywhere in the parameter list: Allow empty lists when nothing is selected for parameters %S, %R, %L, %l, %F, %f, %D, %d, %WL, %WF, %UL and %UF (32/64)
2ghisler(Author)
Thank you for adding this feature to TC 9.20 - I am looking forward to trying it out... :-)

Posted: 2018-05-06, 09:09 UTC
by ghisler(Author)
Please report in the bug reports forum if anything is wrong!