0

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

What am I doing wrong?

1 Answer 1

1

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

do shell script "bash /Users/path/to/file/myShellScript.sh"
Sign up to request clarification or add additional context in comments.

1 Comment

You should also add a shebang line (#!/bin/bash) as the first line of the script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.