> Thanks. This appears to work OK for displaying items from the command line.
> Unfortunately it always sends it's output to stderr which makes it harder to
> catch the output and extract the actual password text from it. Grrrr.
>
> AppleScript may be a workable alternative as it looks like it might be
> easier to get ahold of the actual password text.
>
For the posterity of the ages, here is the ruby code I used to extract the
password. Comments or corrections are welcome... But this seems to work:
def findPassword
retVal = nil;
myin, myout, myerr = Open3.popen3('security find-generic-password -g -s
"PasswordNeeded"')
myin.close
myout.close
myerr.each_line do | fishline |
if fishline =~ /password:[ \t]+\"(.*)\"/ then
retVal = $1
end
end
return retVal
end
I replace PasswordNeeded with whatever password key you like.
Sent using the Microsoft Entourage 2004 for Mac Test Drive.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Apple-cdsa mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/apple-cdsa/email@hidden
This email sent to email@hidden