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.

Govind
  • 2,337
  • 33
  • 43

1 Answers1

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"
Arc676
  • 4,445
  • 3
  • 28
  • 44
  • 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 – Govind Jan 19 '16 at 14:44
  • See my edit. I forgot this was in a script and I didn't notice the shebang – Arc676 Jan 19 '16 at 14:44
  • #! /usr/bin/osascript osascript -e do shell script "chmod 777 /Library/ColorSync/Profiles" with administrator privileges -getting same error – Govind Jan 19 '16 at 14:48
  • 1
    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. – Arc676 Jan 19 '16 at 14:49
  • http://stackoverflow.com/questions/34880124/apple-script-working-fine-but-with-objective-c-library-not-getting-expected-out – Govind Jan 19 '16 at 15:03