Parameter to suppress quotation marks for adjacent parameters

Here you can propose new features, make suggestions etc.

Moderators: Hacker, Stefan2, white

Post Reply
Fla$her
Senior Member
Senior Member
Posts: 455
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 2022-06-21, 16:25 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43759
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: 11880
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, 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 10.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (21H2) 64bit, 'Everything' 1.4.1.1021 (x64)
TC 3.40b4 on Android 6 & 12
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Senior Member
Senior Member
Posts: 455
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? :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43759
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
Senior Member
Senior Member
Posts: 455
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.
Fla$her
Senior Member
Senior Member
Posts: 455
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! :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43759
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
Senior Member
Senior Member
Posts: 455
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?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43759
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
Senior Member
Senior Member
Posts: 455
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.
User avatar
petermad
Power Member
Power Member
Posts: 11880
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, 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 10.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (21H2) 64bit, 'Everything' 1.4.1.1021 (x64)
TC 3.40b4 on Android 6 & 12
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43759
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: 11880
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, 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 10.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (21H2) 64bit, 'Everything' 1.4.1.1021 (x64)
TC 3.40b4 on Android 6 & 12
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Senior Member
Senior Member
Posts: 455
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.
Post Reply