Re: Password-Dialog
Re: Password-Dialog
- Subject: Re: Password-Dialog
- From: Christopher Nebel <email@hidden>
- Date: Thu, 3 Nov 2005 21:07:52 -0800
On Nov 3, 2005, at 12:26 PM, Thomas Vatter wrote:
I try to find out if user has pressed the cancel-button in the
password-dialog that is shown automatically. I need this to cancel
the installation process.
Ah yes, you were asking about this a few days ago. You didn't say,
but it sounds like you're talking about the authentication dialog
from "do shell script with administrator privileges". If the user
presses "cancel", the command will throw an error, which you can
catch using a "try" block like this:
try
do shell script "..." with administrator privileges
on error e number n
-- n is -128, e is "User canceled."
end
Most other dialog commands in AppleScript work this way, including
"display dialog" -- if you have a button named "Cancel" (or the
localized equivalent for your language), pressing it will generate
the same error. ("choose from list" is an exception for historical
reasons.)
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
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