✅ Parameter to suppress quotation marks for adjacent parameters

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

✅ Parameter to suppress quotation marks for adjacent parameters

Post by *Fla$her »

There are situations in which you need to output quotes not at the ends of the path, but in the context of the parameter in which they are included.

For example:

CommandParameters
cmd /v /cset "p=%P%N"
TCFS2 /ef"tcd(,<`%V`>,S)"
etc


Please add a parameter (like %X; %Q, for example) that will suppress quotation marks in the presence of spaces and ampersands.
Suppose: %Q%N, %Q%P%N, %Q%V, %Q%S etc.
Last edited by Fla$her on 2023-10-19, 01:02 UTC, edited 2 times in total.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *ghisler(Author) »

Total Commander only adds automatic quotation marks around a very limited number of values. Instead of
set "p=%P%N"
just use
set "p=%P%O%E"

In other cases it could indeed be helpful.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *petermad »

just use
set "p=%P%O%E"
This should be:

Code: Select all

set "p=%P%O.%E"
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *Fla$her »

ghisler(Author) wrote: 2022-06-21, 07:04 UTCTotal Commander only adds automatic quotation marks around a very limited number of values.
I know. But %X and %Y also have limited terms of use. :wink:
ghisler(Author) wrote: 2022-06-21, 07:04 UTCInstead of
set "p=%P%N"
just use
set "p=%P%O.%E"
I'm well aware of this method. This is only suitable for names with a dot in the name, which does not always meet the conditions, especially with regard to directories.
ghisler(Author) wrote: 2022-06-21, 07:04 UTCIn other cases it could indeed be helpful.
It's good that you understand this. Will you add? :)
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *ghisler(Author) »

Not now, TC 10.50 is feature complete (release candidate), otherwise the beta test will go on forever. I have put it on my wish list, though.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *Fla$her »

2ghisler(Author)
Even the news that in the last session you approved at least one of my (17) requests is already like a balm for the soul. :)
Although in general it is, of course, sad. Some of them could have appeared much earlier.
Overquoting is evil! 👎
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *Fla$her »

2ghisler(Author)
Thanks for adding %Q to TC10.51 RC1! :)
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *ghisler(Author) »

Please test it and let me know if there are any problems! Btw, I also added %X, it inserts the current clipboard contents (if it contains text).
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *Fla$her »

Well, I immediately tested with the parameters I specified. No problems found.
ghisler(Author) wrote: 2022-08-12, 08:20 UTCI also added %X
Explain, please. %X already has its own function:
Dialog box: Configuration - Change button bar wrote:%X Interprets the following parameters after this parameter as left/right instead of source/target:
Maybe you meant [X] for MRT?
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *ghisler(Author) »

Sorry, you are right, I mixed that up.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *Fla$her »

Actually, there is one problem.
"%Q%S" or "%Q%R" logically should return "name1 name2", not "name1" "name2".
I won't say that it is much needed, but it would be logical.
Last edited by Fla$her on 2022-08-15, 02:14 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *petermad »

"%Q%S" or "%Q%R" logically should return "name1 name2", not in "name1" "name2".
I won't say that it is much needed, but it would be logical.
I agree - otherwise there is no way of getting "name1 name2"
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *ghisler(Author) »

%Q%S adds the names without quotes.
"%S" and "%Q%S" adds quotes around every name. while
%S alone only adds quotes around names with spaces.

Adding quotes just before the first and after the last name doesn't really make any sense...
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *petermad »

Adding quotes just before the first and after the last name doesn't really make any sense...
Most likely, but it will depend on what the output is going to be used for and with, so why not let "%S" and "%Q%S give different output.
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter to suppress quotation marks for adjacent parameters

Post by *Fla$her »

ghisler(Author) wrote: 2022-08-15, 15:12 UTCAdding quotes just before the first and after the last name doesn't really make any sense...
It makes sense. For example, you need to get a string list of names without an extension for subsequent insertion into a text file or to get a new name. Removing extensions from a single parameter is easier and faster than processing a list of parameters in a loop.
Overquoting is evil! 👎
Post Reply