Page 1 of 1

✅ Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-06-20, 15:05 UTC
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.

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-06-21, 07:04 UTC
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.

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-06-21, 11:17 UTC
by petermad
just use
set "p=%P%O%E"
This should be:

Code: Select all

set "p=%P%O.%E"

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-06-21, 13:03 UTC
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? :)

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-06-22, 08:15 UTC
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.

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-06-22, 09:50 UTC
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.

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-12, 00:02 UTC
by Fla$her
2ghisler(Author)
Thanks for adding %Q to TC10.51 RC1! :)

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-12, 08:20 UTC
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).

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-12, 10:39 UTC
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?

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-14, 06:40 UTC
by ghisler(Author)
Sorry, you are right, I mixed that up.

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-14, 10:16 UTC
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.

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-14, 10:53 UTC
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"

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-15, 15:12 UTC
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...

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-15, 15:32 UTC
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.

Re: Parameter to suppress quotation marks for adjacent parameters

Posted: 2022-08-16, 06:09 UTC
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.