I have used the command.
/usr/bin/osascript -e 'do shell script "echo hello args 2>&1 etc" with administrator privileges'
It asks for password saying osascript want to make changes. What I want is, how do I change the word osascript?
applescriptterminal
I have used the command.
/usr/bin/osascript -e 'do shell script "echo hello args 2>&1 etc" with administrator privileges'
It asks for password saying osascript want to make changes. What I want is, how do I change the word osascript?
Best Answer
I found a much better way of doing this, by digging through the Applescript doc on the Apple Developer's Site. I found this release note for Applescript in MacOS 10.10
It says:
However, it neglects to say how you can do that. After some guesswork, I figured out that there's a
prompt
clause that lets you replaceosascript wants to make changes...
with whatever you want when usingdo shell script...with administrator privileges
in a script invoked byosascript
. For example:generates a dialog box that looks like:
I hope this helps someone.