Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MarceFX

macrumors member
Original poster
Sep 23, 2006
45
1
Graná (Spain)
Hi there!

I need to add a new label and number to each of my contacts in Address Book. The number must be a copy of each number in each contact. As an example:

- Original -
Name: John Doe
Mobile: 666666
Work: 7777777

- Target -

Name: John Doe
Mobile: 666666
Work: 7777777
New label: XXX666666X
New Label: XXX777777X

So far I've just gotten to the part where I add the "XXX" and the final "X" using this script:

Code:
tell application "Address Book"
   repeat with eachPerson in people
      repeat with eachNumber in phones of eachPerson
         set theNum to (get value of eachNumber)
         if (theNum does not start with "+" and theNum does not start with "1") then
            set value of eachNumber to "XXX" & theNum & "X"
         end if
      end repeat
   end repeat
   save addressbook
end tell

Now I'm stuck on how to create the new phone/label for each contact's phone.

¿Any help please?

Thank you
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.