Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: catching errors on "with administrator privileges"



At 10:24 AM -0400 6/21/06, deivy petrescu wrote:
On Jun 21, 2006, at 9:30, Jeremy Matthews wrote:

I know you can say "on error -128..." (Thanks Kai) when someone cancels an authentication (to perform a specific action), but how do you catch FAILED authentication errors?

What's the syntax there?

Thanks,
jeremy


Use this script:

<script>
try
	do shell script "ls " with administrator privileges
on error number e
	display dialog e
	return e
end try
</script>

enter the wrong password and get the error number:
-->   -60005

And then, write: "on error number -60005" (a common mistake would be: "on error -60005".)


Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >catching errors on "with administrator privileges" (From: Jeremy Matthews <email@hidden>)
 >Re: catching errors on "with administrator privileges" (From: deivy petrescu <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.