Page 1 of 1

/script parameter fails with spaces?

Posted: 24 Oct 2017 23:52
by highend
Not sure if this is a bug but shouldn't this work?

Code: Select all

XYplorer.exe /script="::run '<some path>\<a filename with at least one space>.exe';"
The XYplorer - Scripting window will state that the file can't be found...

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 05:29
by bdeshi
The first example in the reference for run:

Code: Select all

run '"C:\With Blank.txt"';
Names with blanks must be quoted. Note that the quotes have to be wrapped in single-quotes because an argument's outer quotes are auto-stripped by XY's script parser!

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 08:33
by highend
Even inside a /script call?

Doesn't work here and the help file states:
2) A script. It must be preceded by ::, and it must not contain double quotes or other characters that might lead to problems when parsing the command line. For example

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 10:39
by jupe
I think I ran into this before and ::open worked instead though.

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 12:43
by bdeshi
until Don addresses this, you might also get by with quote().

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 14:07
by admin
This works already:

Code: Select all

/script="::run quote('E:\Test\Edit Space.txt');"
This works from next beta as well:

Code: Select all

/script="::run quote("E:\Test\Edit Space.txt");"

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 15:18
by highend
Mh, I could have sworn that I never had problems with quoting in the past when using /script...

Ok, let's live with quote() then

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 15:48
by admin
The source of the difficulty here is run. If the path has spaces then run wants its own quotes in the parameter.

Next version comes with new SC runq which cares for the quoting itself.

Re: /script parameter fails with spaces?

Posted: 25 Oct 2017 19:56
by bdeshi
admin wrote:This works from next beta as well:

Code: Select all

/script="::run quote("E:\Test\Edit Space.txt");"
How's this okay!?