Been trying to work this out this morning and beginning to wonder if this is even possible.
When launching a shell script through Finder, either by using the extension .command or opening .sh files in Terminal, the following command is executed:
Macbook-Pro:~ /Users/mulquin/Desktop/test/Path\ With\ Spaces/run.sh ; exit;
Could not open input file: /Users/mulquin/Desktop/test/Path
Trying it with quotes instead of escape characters yields the same result
Macbook-Pro:~ "/Users/mulquin/Desktop/test/Path With Spaces/run.sh" ; exit;
Could not open input file: /Users/mulquin/Desktop/test/Path
The users this is intended for are not tech savvy so asking them to open Terminal, browse to a directory and ./run.sh is unfortunately not an option.
I had a look at Platypus but the script location will be dynamic as the users will be running it from their desktops or other location they choose.
Has Apple really not noticed this issue or am I doing something wrong?