Hello everyone! Here’s the deal: I’m trying to create some people in “Address Book” but all I managed to set is the first name, last name, note, organization and a few more. I’m having terrible trouble with address, phone, birthday, MSN, ICQ and Yahoo handle.
I searched BBS for a while
but they all talk about how to get stuff, never how to set (or at least not what I 'm looking for)
I tried a few things like:
tell application "Address Book"
set Nico to (item 1 of (every person whose name is "Nik"))
get properties of address of Nico
get properties of Yahoo handle of Nico
end tell
-- this to get an idea of how it works...
tell application "Address Book"
set Nuevo to (item 1 of (every person whose name is "Nik")) -- (was actually a 'make new person with properties:{}')
-- set first name of Nuevo to "Nico" -- this OK
-- set note of Nuevo to "Hello, this worked!" -- and it did...
set properties of Yahoo handle of Nuevo to {label:"Yahoo ID", value:"nicolas_christie"} -- this runs but does nothing
-- set street of address of Nuevo to "9 de Julio 123" -- same with this
save addressbook
end tell
The thing is ‘Yahoo handle’ and ‘MSN’ and ‘address’ are not properties, they’re elements of the ‘class person’ but I have no idea on how to work with those…
What I need would be something like:
make new person with properties {first name:Nombre, last name:Apellido, organization:Compania, email:eMail_Uno, phone:Telefono, birth date:Cumple, ICQ handle:ICQ, MSN handle:MSN, Yahoo handle:Yahoo, address:{street:Direccion, zip:CP, city:Ciudad, state:Provincia, country:Pais}}
And a few of those with different labels (as you may have noticed variables in my code are in spanish, so labels should be too )
OK, thanks a lot for reading, and eventually for answering! Bye!