Skip to content

My first AppleScript: Copy Address Book entries

Tatataa! I just wrote my frist AppleScript. For displaying the buddypicture of my Address Book contacts in Adium, I had to copy the ICQ entry to a new Jabber enrty with appending “”. The code follows:

tell application "Address Book"
set thePeople to every person whose ICQ handles is not {} and Jabber handles is {}
repeat with eachPerson in thePeople
set icqnr to value of ICQ handles of eachPerson
set jabberid to (item 1 of icqnr) & ""
make new Jabber handle at end of Jabber handles of eachPerson with properties {label:"Home", value:jabberid}
end repeat
save addressbook
end tell

It worked out fine. Now I see you all in my buddylist ;-)