Re: Getting .Mac info
Re: Getting .Mac info
- Subject: Re: Getting .Mac info
- From: Jeffrey Mattox <email@hidden>
- Date: Fri, 24 Jan 2003 03:03:56 -0600
In the same vein as how to get the default browser, how can I get the user's
.Mac member name and password? The password might be impossible (if it's
encrypted) but having the member name at least would be nice. I looked at the
com.apple.* files using the 'defaults' tool but didn't find where this
information is stored. Any ideas?
This works:
set idiskName to contents of default entry "iToolsMember" of user defaults
if ( getPassword() is true ) then -- look through the keychain for
the password
-- success, password is set
else
-- failure
end if
...
on getPassword ()
tell application "Keychain Scripting"
-- get current keychain
set theName to ((name of current keychain) as string)
unlock current keychain
-- scan through the keys
set theKeyList to get keys of current keychain
set theIndex to 1
repeat with theKey in theKeyList
set theName to name of key theIndex of current keychain as string
set theAccount to (account of key theIndex of current
keychain as string)
set theDesc to description of key theIndex of current
keychain as string
set theService to service of key theIndex of current
keychain as string
-- display dialog "n:" & theName & " a:" & theAccount &
" d:" & theDesc & " s:" & theService
if (theService is "iTools" and theAccount is idiskName) then
set password to (password of key theIndex of current
keychain as string)
-- display dialog "key: " & theName & " iDisk: " & idiskName &
" pw: " & password
return true -- iTools password found in keychain
end if
set theIndex to theIndex + 1
end repeat
end tell
return false -- iTools password not found in keychain
end getPassword
As usual, some of those line pairs should be all one line.
Jeff
_______________________________________________
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.