Re: Getting values from keychain
Re: Getting values from keychain
- Subject: Re: Getting values from keychain
- From: Isaac Ordonez <email@hidden>
- Date: Thu, 13 May 2004 15:42:58 -0700
I actually got it working using the following code. I would have liked
to make it shorter though, seems like a lot of repetition for just
getting a few values... Anyone see a way to trim this bloat down?
on keychainpass(myvalue)
try
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Add User Info"
set endvalue to (password of theKey) as string
return endvalue
end tell
end tell
end try
end keychainpass
on keychainname(myvalue)
try
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Add User Info"
set endvalue to (account of theKey) as string
return endvalue
end tell
end tell
end try
end keychainname
on keychainserver(myvalue)
try
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Add User Info"
set endvalue to (server of theKey) as string
return endvalue
end tell
end tell
end try
end keychainserver
property importpass : my keychainpass("password") as string
property importname : my keychainname("account") as string
property myServer : my keychainserver("server") as string
Isaac Ordonez
Technology Support Specialist II
San Rafael City Schools
415.302.8114
On May 13, 2004, at 3:28 PM, travis n wrote:
Greetings Isaac,
This is inline with my thread "scripting keychain access"
Keychain 1 should return the same as "current keychain" which for
myself (and maybe others) always looks empty. All requests for its
keys returns an empty set. Therefore, you properties are never
defined because the function errors out.
try this little script and let me know if you get any values returned:
tell application "Keychain Scripting"
set defaultKeychain to current keychain
set uName to keys of defaultKeychain
end tell
the event log reports:
tell application "Keychain Scripting"
get current keychain
current application
get current keychain
keychain "login.keychain"
get every key of keychain "login.keychain"
{}
end tell
_____________________
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 13, 2004, at 1:01 PM, Isaac Ordonez wrote:
on keychain(myvalue)
try
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Add User Info"
set myvalue to (myvalue of theKey) as string
end tell
end tell
end try
end keychain
property importname : my keychain("password")
property importpass : my keychain("account")
property myServer : my keychain("server")
on clicked theObject
display dialog "Password:" & importpass & " User:" & importname & "
Server:" & myServer & ""
end clicked
_______________________________________________
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.