re: Keychain Access ... contains?
re: Keychain Access ... contains?
- Subject: re: Keychain Access ... contains?
- From: David Crowe <email@hidden>
- Date: Mon, 7 Feb 2005 08:40:24 -0700
Brian;
You've discovered the same thing as me (I posted on this earlier).
The only way to match the name of a key in the keychain is,
apparently, to scan through the list.
But, I just had an idea, that would work, although it's a lot of scripting.
Assuming that you don't compile your script every time you could read
the name of every item of the keychain into the list once (i.e. store
it as a script property), and then use that as an index.
If the keychain changes it would be easy to tell if you were in the
wrong place (i.e. if you find list item 59 as name "www.apple.com",
but the keychain says it is something else) you could then rebuild
the list (either from scratch or attempt to edit it back into
alignment, although that would be more complex).
This would mean you would take a hit whenever you modified the list
in a way which changed the position of the key you're looking for (or
whenever you recompiled the script), but you might still gain a big
benefit in speed most of the time. More sophisticated, but slightly
slower, you could store the list in a text file, meaning that the
list would be preserved across script compilations.
If anyone implements an algorithm like this I hope they'll share it :)
- David Crowe
_______________________________________________
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