add contacts to address book

i’m a moderately experienced applescripter, and i’m currently building an application to simplify the adding of address book contacts.
what i need to do is create a new card (that part i’ve already got), and define the street address, state, city, country, and zip code. i have all of the other information working correctly, such as email addresses and phone numbers, but this stuff just isn’t working.
HELP!!!
thanks
-renaissanceboy
:):):):):):):):):):):):):):slight_smile:

Model: eMac
Operating System: Mac OS X (10.3.9)

Hi renaissanceboy,

This works for me:

tell application "Address Book"
	set myCard to make new person with properties {first name:"John", last name:"Smith"}
	tell myCard
		make new address at end of addresses with properties {street:"8 My Street", city:"London", state:"Middlesex", zip:"X1 1XX", country:"England", country code:"UK", label:"Work"}
	end tell
	save addressbook
end tell
-- Also, but not needed - to open the card in Adddress Book
tell application "Address Book"
	set myID to id of myCard
end tell
open location "addressbook://" & myID

Best wishes

John M

thanks a ton, i’ll try it and post another reply when i’m done to tell you how it works.
-renaissanceboy
:):):):slight_smile:

I’d like a an email script that goes a bit further. First, I’m very, very new to scripting. I used Claris Emailer until about a year ago. One thing it allowed me to do was control a newsletter mailing list. If, for example, someone sent me an email with the subject “SUBSCRIBE”, it would add their name to a predetermined mailing group and send a confirmation email. If they sent an email with the subject “UNSUBSCRIBE”, it would search the specified groups looking for that address, and remove it from the group and also send a confirmation. In OS X Mail I have to do this manually, is there a script to do these, or can someone assist me in writing one?

Model: iMac 2Ghz
Browser: Safari 412.2
Operating System: Mac OS X (10.4)

I’m using the FrontBase Applescript engine to query the database and receive the data in an arrary
i’m able to add contacts to Address Book in a repeat and assign them to a specific group
but i am not able to assign the phone number (business phone) to the created person

another thing, how do i find out if the person already exists in Address Book,
so replacing information instead of adding another contact ?

Thanks,
Geert

Model: PowerBook G4
AppleScript: of 10.3.9
Browser: Safari 312.3
Operating System: Mac OS X (10.4)

I like many Mac’ers love to Apple Script whenever it’s reasonable.
But when it gets very involved I look for other means to accomplish my needs.

In the case of adding entries to Address Book I have reverted to “AddressBookQuickEntry”

http://macupdate.com/info.php/id/17481

It’s freeware and works great !