The problem I'm trying to solve is to simply run Google Chrome with the --disable-web-security switch in OSX. Since it appears that I cannot add a switch (argument) to an alias I started looking for other options. The suggestion that appeared most often was to use an Applescript and call it from an alias. So I set it up and the script is as follows:

do shell script "exec /Applications/Google Chrome.app/Contents/MacOs/Google Chrome --disable-web-security"

When I run the script I get the error:

sh: /Applications/Google: No such file or directory sh: line 0: exec: /Applications/Google: cannot execute: No such file or directory

The script won't process the path past the space in "Google Chrome". How can I modify this script to run with the spaces in the path?

Any help is appreciated.


Like this...

set s to "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
do shell script "exec " & quoted form of s & " --disable-web-security"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.