Re: adding authentication...
Re: adding authentication...
- Subject: Re: adding authentication...
- From: Graff <email@hidden>
- Date: Mon, 17 May 2004 18:10:56 -0400
What you need to do is to bring up a dialog window which asks for the
password, then pass that password to the command. Here's how I would
do it in a regular ScriptEditor-created application:
----
display dialog "Enter in your password" default answer "" buttons
{"Cancel", "Erase Files"} default button "Erase Files"
set theReply to result
if button returned of theReply is "Erase Files" then
set thePassword to text returned of theReply
do shell script "sudo rm -r /somepath/somefile" password thePassword
with administrator privileges
end if
----
- Ken
On May 17, 2004, at 2:32 PM, Martha Espinosa wrote:
Hi,
I have a cocoa application written in applescript. Mostly using do
shell commands. I need to have the user type in their admin password.
I don't want to use the typical window when you use "do shell script
"sudo rm -r /somepath/somefile with administrator privileges"
Does anyone have an example to help me achieve this?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.