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