• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Create a person in Address Book
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create a person in Address Book


  • Subject: Re: Create a person in Address Book
  • From: Paul Berkowitz <email@hidden>
  • Date: Wed, 02 Oct 2002 00:49:05 -0700

On 10/2/02 12:00 AM, "Matthew Smith" <email@hidden> wrote:

> I am trying to use AppleScript to create a person in the Address Book. I can
> create a person, but haven't found a way to include a person's phone
> numbers, addresses, email addresses and instant message accounts.
>
> I tried the following but it didn't work.
>
> tell application "Address Book"
> make new person with properties {first name: "Steve", last name: "Jobs",
> email:{label:"home", value:"email@hidden"}}
> end
>
> How do I create and add elements to Address Book persons?

They're not properties, they're elements. Just make them 'at' the person, pr
tell the person to make them him/herself, with the added Cocoa oddity of
having to make them at the 'beginning' or 'end' of all such elements:

tell application "Address Book"
set newPerson to make new person with properties {first name: "Steve",
last name: "Jobs"}
tell newPerson to make new email at end of emails with properties
{label:"home", value:"email@hidden"}
save addressbook
end

(Mustn't forget to 'save addressbook' at the end, or periodically, or it can
all go up in a puff of smoke.


--
Paul Berkowitz
_______________________________________________
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.

  • Follow-Ups:
    • Re: Create a person in Address Book
      • From: Rob Jorgensen <email@hidden>
    • Re: Create a person in Address Book
      • From: Matthew Smith <email@hidden>
References: 
 >Create a person in Address Book (From: Matthew Smith <email@hidden>)

  • Prev by Date: RE: Reading Folder Names
  • Next by Date: Script to change the default browser on Mac OS X
  • Previous by thread: Create a person in Address Book
  • Next by thread: Re: Create a person in Address Book
  • Index(es):
    • Date
    • Thread