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/myShellScript.sh: Permission denied" number 126
cd /Users/myusername/Git/myproject/
git remote remove origin
do shell script "/Users/path/to/file/myShellScript.sh"

What am I doing wrong?

  • What's the output of ls -l /Users/path/to/file/myShellScript.sh ? Maybe the executable bit isn't set? – D Schlachter Apr 17 '16 at 3:47
Command Line
chmod a+x myShellScript.sh


do shell script "bash /Users/path/to/file/myShellScript.sh"

Plus: add shebang to top of shell script


Note: If you want to use sh over bash, just substitute it in the command and the shebang.

|improve this answer|||||

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.