2
#! /usr/bin/osascript
osascript -e "do shell script 
"chmod 777 /Library/ColorSync/Profiles" with administrator privileges"

Error: Expected end of line, etc. but found “"”.

I am new to apple script. I need to run this with NSAppleScript. AS first step, from the script editor I am getting the above error message.

1 Answer 1

3

You have the #!/usr/bin/osascript shebang. You don't need to call osascript in your code. Just do:

#!/usr/bin/osascript
do shell script "foo"
Sign up to request clarification or add additional context in comments.

5 Comments

Executed this #! /usr/bin/osascript osascript -e 'do shell script "chmod 777 /Library/ColorSync/Profiles" with administrator privileges' Getting same error. Instead of """, message become unknown character
See my edit. I forgot this was in a script and I didn't notice the shebang
#! /usr/bin/osascript osascript -e do shell script "chmod 777 /Library/ColorSync/Profiles" with administrator privileges -getting same error
You don't need to call osascript in your script because the shebang already uses the AppleScript command. Read the second script carefully. Actually, I'll just remove the first one.

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.