Mowzer Mowzer - 7 months ago 14
Bash Question

How to run a shell script from an AppleScript?

I am using a Mac running OSX Yosemite v.10.10.5.

When I try to run my shell script from my AppleScript, I get the following error message:

Error message at AppleScript Script Editor

error "sh: /Users/path/to/file/ Permission denied" number 126

cd /Users/myusername/Git/myproject/
git remote remove origin


do shell script "/Users/path/to/file/"

What am I doing wrong?


You shell script is probably missing the execute permission (+x). Add it with the shell command chmod a+x or prepend the shell script with the shell executable name, e.g.:

do shell script "bash /Users/path/to/file/"