Add credentials to the keychain from a list of default accounts

Hello Folks,

OS X supplied tools and technologies are my first choice as they are already there in every installation of OS X. So, I decided to use the Keychain application as linchpin for all my login credentials (eMail, forums, social networks, etc).

As shown in the following script, I already managed to add new entries with preallocated default settings to the keychain using Applescript.

set _creator to "apsr" -- Abbrevation for AppleScript
set _protocol to "htps"
set _keychain to "Internet"

set _app_safari to "/Applications/Safari.app"
set _app_keychain to "/Applications/Utilities/Keychain Access.app"

set _url to the text returned of (display dialog ("URL: ") default answer "mail.google.com")
set _label to the text returned of (display dialog "Name" with title "User" default answer "Braeburn")
set _account to _label & "@" & _url
set _accnt to the text returned of (display dialog "Account" with title "Account" default answer _account)
set _srvr to the text returned of (display dialog "WebSite" with title "Site" default answer _url as string)
set _passwd to the text returned of (display dialog "Password" with title "Password" default answer "myP@ssWd" as string)
set _proto to the text returned of (display dialog "Protocol" with title "Site" default answer "htps" as string)
set _path to the text returned of (display dialog "Path" with title "Path" default answer "XXX" as string)
set _comment to the text returned of (display dialog "Comment" with title "Comment" default answer "email-address: Braeburn@gmail.com" as string)

do shell script ¬
	"/usr/bin/security add-internet-password   " & ¬
	" -a " & _account & ¬
	" -l " & _label & ¬
	" -c " & _creator & ¬
	" -s " & _srvr & ¬
	" -r " & _proto & ¬
	" -w " & _passwd & ¬
	" -p " & _path & ¬
	" -T " & _app_safari & " " & ¬
	" -T " & quoted form of _app_keychain & ¬
	" " & _keychain

BTW: As “Keychain Scripting” is notorious about the slowness, I decided to use the command line tool “security” to interact with the Keychain environment. So far so good.

Obviously, most of us have several accounts and therefore I would like to have a preallocated list of default credentials where I can choose from and change it to my needs. The example here http://macscripter.net/viewtopic.php?id=14995 (Post #5) achieve most of what I am looking for.

The entries in the list should contain something like this:

[USER, PASSWORD, URL, PATH, NOTES]
Braeburn, Braepasswd, www.macscripter.net, login.php, Great resource for AS
Steve, FooPassBar, www.gmail.com, login.php, Googlemail Account

Unfortunately, due to the lack of knowledge with AS, I am unable to wrap something like a “properties list” around my keychain script.

Therefore, I would highly appreciate any base frame script how to achieve a property-list around the keychain script.

Best regards and thank you in advance.

M.