Re: Keychain Scripting
Re: Keychain Scripting
- Subject: Re: Keychain Scripting
- From: "John C. Welch" <email@hidden>
- Date: Sun, 02 Mar 2003 13:23:10 -0500
On 03/02/2003 12:36, "Richard Simms" <email@hidden> wrote:
>
I have made a script to check my email on Eudora but I still get
>
asked for my password. According to my scripting addition all I have
>
to type is:
>
>
if "My Email" locked = true then
>
unlock "My Email" with password "mypasssword"
>
end if
>
>
The problem is that this won't even compile let alone unlock the
>
keychain. Any ideas?
This should get you the specific userid and password for a desired key. You
just hardcode the key name into the script. From there, you can (in theory)
pass that to Eudora. (I don't script Eudora, so I don't know if it will work
or not).
set theShortUserName to do shell script "/usr/bin/whoami" --get the short
userid. This is how your default keychain is labled.
tell application "Keychain Scripting"
set myKeyChain to keychain theShortUserName
set theKeyList to every Internet key of myKeyChain --email keys are
normally Internet Keys
repeat with x from 1 to (length of theKeyList)
set theKey to item x of theKeyList
if the name of theKey is "name of key here" then
set thePassword to password of theKey --grab the password
set theUserID to the account of theKey --grab the userid
end if
end repeat
end tell
john
--
"It was completely involuntary. They sank my boat."
- John F. Kennedy on his wartime heriocs
_______________________________________________
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.