Navigation

6/16/2014

Applescript: administrator privileges




How do I get administrator privileges for a command?

Use the administrator privileges, user name and password parameters like this:
 
do shell script "command" user name "me" password "mypassword" with administrator privileges

user name and password are optional; if you omit the user name, do shell script assumes it to be the current user; if you omit the password, it will ask for a password when it runs. Once a script is correctly authenticated, it will not ask for authentication again for five minutes. As of Mac OS X 10.4, this grace period does not extend to any other scripts or to the rest of the system;

No comments:

Post a Comment