Re: catching errors on "with administrator privileges"
Re: catching errors on "with administrator privileges"
- Subject: Re: catching errors on "with administrator privileges"
- From: kai <email@hidden>
- Date: Wed, 21 Jun 2006 17:10:33 +0100
On 21 Jun 2006, at 15:24, deivy petrescu wrote:
enter the wrong password and get the error number:
--> -60005
It may already be clear Jeremy but, just to follow through on Deivy &
Emmanuel's good advice...
If you have several potential error types on which you wish to take
further action, you can simply use a series of if/then statements.
While the following example will handle cancellations and
authentication failures, it will still throw an error if any other
exception occurs:
--------
try
do shell script "" with administrator privileges
simulated_error()
on error e number n
if n is -128 then -- perform any action(s) required following a user
cancellation - for example:
display dialog "Had enough?"
else if n is -60005 then -- similar sort of thing for an
authentication failure:
display dialog "Memory playing tricks on you?"
else -- reissue any error that hasn't already been trapped/remapped
error e number n
end if
end try
--------
---
kai
_______________________________________________
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