Hi,
it seems like shell.openPath()
doesn’t like the path string to be encodeURI()
-ed in advance on a Mac.
When the path contains a space, it translates (as expected) to %20
, but openPath()
doesn’t like it and it fails to find/open the asset. If the path has no spaces, it works either with or without encodeURI()
—as I’d expect.
To sum up:
// On a Mac
shell.openPath(encodeURI(somePathWithSpaces)); // FAILS ?
shell.openPath(somePathWithSpaces); // OK
// On Windows
shell.openPath(encodeURI(somePathWithSpaces)); // OK!
shell.openPath(somePathWithSpaces); // OK
Correcting for platform (escape chars, forward vs. backward slashes, etc), it seems like spaces in the paths are not an issue on Windows, as my friend @svumme told me after performing a bunch of tests.
Could you please confirm that this is the expected behaviour, and we should basically never use encodeURI()
to be sure everything works on both platforms?
Thank you!!
—Davide