• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: adding authentication...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: adding authentication...
      • From: Gnarlodious <email@hidden>
References: 
 >adding authentication... (From: Martha Espinosa <email@hidden>)

  • Prev by Date: Re: adding authentication...
  • Next by Date: Q: echo | sed ; can't replace range of lines
  • Previous by thread: Re: adding authentication...
  • Next by thread: Re: adding authentication...
  • Index(es):
    • Date
    • Thread