Re: Catch Deny from Keychain Permission Dialog?
Re: Catch Deny from Keychain Permission Dialog?
- Subject: Re: Catch Deny from Keychain Permission Dialog?
- From: Doug Adams <email@hidden>
- Date: Wed, 20 Jun 2007 10:34:35 -0400
> Also, it didn't
> beat the freeze after hitting "Deny".
I know it's not ideal by any means, but it did quit the keychain
dialog and
throw an error for the script OMM. Are you sure you waited for 20
seconds?
The time can be shortened, of course.
Yes, it worked fine, but not pretty enough. ;)
Turns out security _did_ work well (I've left the text_to_list
handler out; everyone knows what that is):
--
to get_keychain_info(service_name)
set {actname, pword} to {"", ""}
try
set x to (do shell script "security find-generic-password -s " &
quoted form of service_name & " -g 2>&1")
set pword to first item of my text_to_list(last item of my
text_to_list(x, "password: \""), "\"")
set actname to first item of my text_to_list(last item of my
text_to_list(x, "\"acct\"<blob>=\""), "\"")
end try
return {actname, pword}
end get_keychain_info
--
The try block catches an error from security when "Deny" is clicked.
This is _way_ faster than Keychain Scripting, too. I will probably do
some grep and sed stuff to eliminate the ugly text_to_list routines.
Thanks for the attention,
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:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden