• 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: do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script


  • Subject: Re: do shell script
  • From: Bill Briggs <email@hidden>
  • Date: Wed, 16 Feb 2005 06:57:48 -0400

At 12:38 AM -0700 2/16/05, Michelle Steiner wrote:
On Feb 15, 2005, at 5:57 PM, Bill Briggs wrote:


You can coax that error to come back to AppleScript if you do a bit of shell redirection. The shell has three "files" it uses, apart from the files you explicitly name in your file system. Standard Input is 0, Standard Output is 1, Standard Error is 2. You can redirect these, and in this case you want to redirect Std Error back to Standard Output so it'll be fed back to the Script Editor (which I assume at this point only gets fed Std Out when the script completes (or not)). If you use this command.


do shell script "pmset -a ams 0 2>&1" password "wrongpword" with administrator privileges

you should get the error message when you feed it a bogus password. I used a different parameter but fed it the wrong password and got the error back by doing this:

do shell script "pmset -c spindown 30 2>&1" password "wrongpword" with administrator privileges

Try that on your machine and you should get the error kicked back if you issue the shell an incorrect password.

It doesn't return an error to the script.

Hmm. It works on my PowerBook. I get an "incorrect password attempt" error back from Script Editor.


- web
_______________________________________________
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: do shell script
      • From: Michelle Steiner <email@hidden>
References: 
 >do shell script (From: Michelle Steiner <email@hidden>)
 >Re: do shell script (From: Bill Briggs <email@hidden>)
 >Re: do shell script (From: Michelle Steiner <email@hidden>)
 >Re: do shell script (From: Bill Briggs <email@hidden>)
 >Re: do shell script (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: path to confusion
  • Next by Date: Re: path to confusion
  • Previous by thread: Re: do shell script
  • Next by thread: Re: do shell script
  • Index(es):
    • Date
    • Thread