/script parameter fails with spaces?

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

/script parameter fails with spaces?

Post 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...
One of my scripts helped you out? Please donate via Paypal

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: /script parameter fails with spaces?

Post 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!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: /script parameter fails with spaces?

Post 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
One of my scripts helped you out? Please donate via Paypal

jupe
Posts: 3574
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: /script parameter fails with spaces?

Post by jupe »

I think I ran into this before and ::open worked instead though.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: /script parameter fails with spaces?

Post by bdeshi »

until Don addresses this, you might also get by with quote().
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 67292
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: /script parameter fails with spaces?

Post 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");"

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: /script parameter fails with spaces?

Post 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
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 67292
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: /script parameter fails with spaces?

Post 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.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: /script parameter fails with spaces?

Post 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!?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply