Re: Root User
Re: Root User
- Subject: Re: Root User
- From: Luther Fuller <email@hidden>
- Date: Sun, 30 Mar 2014 11:51:39 -0500
I just tested the following handler in OS X versions 10.7.5, 10.8.5 and 10.9.2.It worked correctly and perfectly.
on getAdminPrivs() set AppleScript's text item delimiters to " " do shell script "id -G -n" "admin" is in (text items of the result) if the result then return -- current user is admin try do shell script "sw_vers" with administrator privileges return -- admin username & password entered end try error number -128 -- kill this application end getAdminPrivs -----------------------------------
Use it like this ...
on run my getAdminPrivs() -- -- your code here -- cannot be run -- without admin privileges -- end run
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >Root User (From: Luther Fuller <email@hidden>) |