• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Catch Deny from Keychain Permission Dialog?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: creating a dictionary for an applescript app?
  • Next by Date: Re: Image Events & String Coercion
  • Previous by thread: Re: Catch Deny from Keychain Permission Dialog?
  • Next by thread: Amazon Web Services
  • Index(es):
    • Date
    • Thread