Keychain - Quit Application?

Hi Folks,

I am looking for a way to quit my application when the Password has been entered wrong for 3 times - if the password is
correct, then the script should run through…

try
		do shell script "echo ''" with administrator privileges
		
	on error errorMsg number errorNum
		if errorNum is -128 then ¬
			quit theApplication
	end try

In my opinion it should look like this - but it is not working - even if I enter the password wrong for 3 times the appli is running…

Thanks for any help and suggestions…

Stefan

This works for me:


try
	do shell script "echo ''" with administrator privileges
on error e
	if e contains ("incorrect" as Unicode text) then
		display dialog e
		return
	end if
end try
display dialog "Made it"

Hi Adam,

this works perfect:


try
		do shell script "" with administrator privileges
	on error e
		if e contains ("incorrect" as Unicode text) then
			quit theApplication
			return
		end if
	end try


Thanks for your help!

Stefan