• 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
This Used To Work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

This Used To Work


  • Subject: This Used To Work
  • From: Marconi <email@hidden>
  • Date: Thu, 24 Mar 2005 09:45:32 -0700

For terminal commands that require root, this used to work:

tell application "Terminal"
	activate
	do script "sudo requires_sudo_or_root" in front window
	delay 2
	do script "my_password" in front window
end tell

At some point, presumably after some system update, this stopped working and the second 'do script' does not result in the password being typed into the terminal window.

I've looked at the man page for 'expect' and am a bit overwhelmed by it, but I believe that expect might cope with this properly.

The 'expect' examples referred to on the man page don't seem to exist. Would anyone care to demonstrate how to invoke an 'expect' script via AS to accomplish a simple sudo command?

TIA


--
"Beware of all politicians at all times, but beware of them most sharply when they talk of reforming and improving the constitution." -- H. L. Mencken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: This Used To Work
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: RE: Issue with AS variable in OS 10.2
  • Next by Date: Re: Issue with AS variable in OS 10.2
  • Previous by thread: Re: Get download folder
  • Next by thread: Re: This Used To Work
  • Index(es):
    • Date
    • Thread