Re: Keychain scripting...
Re: Keychain scripting...
- Subject: Re: Keychain scripting...
- From: travis n <email@hidden>
- Date: Fri, 14 May 2004 21:17:28 -0500
Greetings,
I was able to remove the empty list problem by moving my private key
(s/mime) certificate (from thawte) to another keychain. I created a
new blank keychain and added one test key and I was able to list it.
Then I added keys back until I isolated that one as the culprit. Which
ever keychain I add it to, the request for all keys of that keychain
becomes an empty list and is restored when I remove it.
Does this work for others?
Now I have the problem, that I can get a listing like:
get every key of keychain "login.keychain"
{generic key 1 of keychain "login.keychain", generic key 2 of
keychain "login.keychain", generic key 3 of keychain "login.keychain",
generic key 4 of keychain "login.keychain", generic key 5 of keychain
"login.keychain", generic key 6 of keychain "login.keychain", .....}
but I cannot extract data any further such as name and account, but I
may be missing something easy here...
-travis n
_____________________
If your face were depicted in this fashion only once, no one would ever
be able to forget you ... For if a lover's face survives emblazoned on
your heart, the world is still your home.
-from "My Name is Red" by Orhan Pamuk
On May 14, 2004, at 12:44 PM, Paul Berkowitz wrote:
On 5/14/04 9:21 AM, "David Crowe" <email@hidden> wrote:
I use the following code to access the KeyChain:
tell application "Keychain Scripting"
set KeyList to every key of keychain KeychainName
repeat with aKey in KeyList
if name of aKey = PINKeychain then
set theSecuridPIN to (password of aKey)
exit repeat
end if
end repeat
end tell
I do a loop because I couldn't reliably pull out the right record by
name. PinKeychain is just a string. and "KeychainName" is just the
name of the keychain.
For example:
key of keychain "DavidCrowe" whose name contains "a"
returns the error:
Can't get key of keychain "DavidCrowe" whose name contains "a"
Correct syntax is
first key key of keychain "DavidCrowe" whose name contains "a"
However, the problem I'm getting (in Panther OS 10.3.3) is that
every key of keychain KeychainName
--> {}
is a list of no items no matter which keychain I use. So 'first key
whose
[anything is anything]' is always going to be an error. And looping
through
KeyList is going to produce nothing at all since the list is empty. It
seems
to be broken.
A shame, since I even came up with a good way to avoid the OS 9
Keychain
Scripting app from coming up.
set osXKeychainScriptingPath to (path to scripting additions from
system
domain as Unicode text) & "Keychain Scripting.app:" -- one line
using terms from application "Keychain Scripting"
tell application osXKeychainScriptingPath
set KeyList to every key of current keychain
repeat with aKey in KeyList
if name of aKey = "AppleID" then
set theSecuridPIN to (password of aKey)
exit repeat
end if
end repeat
end tell
end using terms from
It gets
set allNames to (name of every keychain)
just fine, but substituting any of them (keychain "login.keychain",
keychain
3) instead of (current keychain) doesn't help at all.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.