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

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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.
Last edited by petermad on 2021-05-29, 19:36 UTC, edited 1 time in total.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Support++
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post 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.
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post 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.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post 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.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post 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.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post 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.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

OK - but maybe for the next TC release?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I will add it to my todo list.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post 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... :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Please report in the bug reports forum if anything is wrong!
Author of Total Commander
https://www.ghisler.com
Post Reply