• 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
trying to change Address Book phone labels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trying to change Address Book phone labels


  • Subject: trying to change Address Book phone labels
  • From: "Ken G. Brown" <email@hidden>
  • Date: Wed, 21 Oct 2009 17:27:23 -0600

Title: trying to change Address Book phone labels
Using latest Script Debugger in OS X 10.6.1.

I'm trying to change my Address Book contact phone labels to something shorter that will print completely.

So far I have this:

tell application "Address Book"
activate
       
set thePeople to every person
  
set numberOfPeople to count of thePeople
       
repeat with peopleIndex from 1 to numberOfPeople
                set aPersonProperty to properties of phones of (item peopleIndex of thePeople)
         
set numItems to count of aPersonProperty
               
               
repeat with phoneIndex from 1 to numItems
                      
set thisPhone to (item phoneIndex of aPersonProperty)
                  
set thisLabel to the label of thisPhone
               
                       
if (thisLabel is equal to "ph-home") or (thisLabel is equal to "home") then
                            
--      display dialog "ph-home found"
                         
set the label of thisPhone to "ph-hm"
                  
else if (thisLabel is equal to "phone-work") or (thisLabel is equal to "work") then
                            
set the label of thisPhone to "ph-wk"
                  
else if (thisLabel is equal to "phone-mobile") or (thisLabel is equal to "mobile") then
                       
set the label of thisPhone to "ph-cell"
               
end if
                 
                       
tell application "Address Book"
                       
save
                   
end tell

                end repeat
     
end repeat
end tell

Even though thisLabel picks up the correct values from Address Book and correctly enters the proper if conditions, and the label of thisPhone appears to get changed, nothing ever changes in Address Book. Next time I run the script, the contacts still have the old labels.

Can anyone shed light on why Address Book isn't getting the new labels?

Thx in advance for any tips.

Ken G. Brown
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: trying to change Address Book phone labels
      • From: "Ken G. Brown" <email@hidden>
    • Re: trying to change Address Book phone labels
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: watermark
  • Next by Date: Re: trying to change Address Book phone labels
  • Previous by thread: Fwd: Safari: When do changes to a <textarea> show up in AppleScript "get the text..."
  • Next by thread: Re: trying to change Address Book phone labels
  • Index(es):
    • Date
    • Thread