Mailing Lists: Apple Mailing Lists

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

Catch Deny from Keychain Permission Dialog?



I have a script app which gets the account and password from a particular generic key from the Keychain at startup. When the account and/or password is changed by the app, the _next_ time the script is run Keychain asks for permission to access. All OK when "Allow Once" or "Always Allow" button is clicked. When "Deny" is clicked, Keychain Scripting freezes and app does not proceed.

How do I catch the "Deny" button response?

Here is the code I am using:

--
to get_keychain_info(k)
	my startKeychainScripting() -- Apple's routine to jump start Keychain
	tell application "Keychain Scripting"
		launch
		tell current keychain
			repeat with this_key in (get every generic key)
				if (get service of this_key) is k then
					return {this_key's account, this_key's password}
					exit repeat
				end if
			end repeat
			return {"", ""}
		end tell
	end tell
end get_keychain_info--

Any thoughts appreciated.

Cheers,
Doug
--
Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/

_______________________________________________
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
Archives: http://lists.apple.com/archives/applescript-users

This email sent to 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.