Page 1 of 1

Please add unquote parameters for %N %S and so on.

Posted: 2019-12-17, 01:50 UTC
by dindog
I am not really familiar with command line, so I met great difficulty in handling quoted and unquoted file name for its inconsistency, like this:

askparam.exe /u"path: %P%N" /t"path: %T%N" /p(e) cmd /k echo %001

askparam is a small tool written by MVV which allows user select predefined option in a GUI for command line tools. TC will automatic adding quote mark when the file name full path has space in it which will break existing /u and /t quote mark, even this tool provide a param like /q"`" to input double quote mark in other character, I can do nothing with TC added quote mark.

If an unquote %N is available, I can use below code to ensure it's properly quoted:
askparam.exe /q"`" /u"path:` %P%N`" /t"path: `%T%N`" /p(e) cmd /k echo %001

Re: Please add unquote parameters for %N %S and so on.

Posted: 2019-12-17, 05:34 UTC
by MVV
I agree that quoting logic of TC parameter placeholders is a bit weird, and it would be much better to have two sets of placeholders (or maybe a set and a Q modifier, like in MultiArc), one always unquoted and another always quoted, and so for every single placeholder (P, N, T, M, S, *L etc). And it would be a really nice addition in TC 9.5. :D

But as for AskParam, you can use workarounds:

Code: Select all

AskParam.exe /u"path: "%P%N /t"path: "%T%N /p(he) cmd /k echo "%%001" -- adjacent quoted strings are concatenated
AskParam.exe /u"path: %P%O.%E" /t"path: %T%O.%E" /p(he) cmd /k echo "%%001" -- %O.%E is never quoted
(fixed %T%O.%E)

Re: Please add unquote parameters for %N %S and so on.

Posted: 2019-12-17, 09:32 UTC
by ghisler(Author)
%T%N%O.%E should be %T%O.%E

Re: Please add unquote parameters for %N %S and so on.

Posted: 2019-12-17, 16:44 UTC
by dindog
MVV wrote:
2019-12-17, 05:34 UTC
I agree that quoting logic of TC parameter placeholders is a bit weird, and it would be much better to have two sets of placeholders (or maybe a set and a Q modifier, like in MultiArc), one always unquoted and another always quoted, and so for every single placeholder (P, N, T, M, S, *L etc). And it would be a really nice addition in TC 9.5. :D

But as for AskParam, you can use workarounds:

Code: Select all

AskParam.exe /u"path: "%P%N /t"path: "%T%N /p(he) cmd /k echo "%%001" -- adjacent quoted strings are concatenated
AskParam.exe /u"path: %P%O.%E" /t"path: %T%N%O.%E" /p(he) cmd /k echo "%%001" -- %O.%E is never quoted
I think the first work-around would serveice most of my purpose. I'll use this tips if TC don't add unquoted placeholder in the end. Thanks.

The second will leave a "." if the item on the cursor is a folder.