Address Book copy and change

Hello there,
I was wondering how I can copy all phone-no. entries of all users and add a new label but keep the existing no. and add a prefix.
Example:
Jon Doe, work:0013051234567 (keep this entry and create a new one: Jone Doe, work-1:999,0013051234567)...
Is this possible and how?

That helped. Try this:property ServicePrefix : "0435269981,"
property ServiceName : "-10881"
tell application "Address Book"
repeat with personEntry in people --in group "Test"
set personID to id of personEntry
repeat with phoneEntry in phones of person id personID
set phoneLabel to label of phoneEntry & ServiceName
--set phoneNumber to value of phoneEntry
set phoneNumber to cleanedUpNumber of me instead of (value of phoneEntry)
if first character of phoneNumber is "+" then
set phoneNumber to ServicePrefix & characters 2 thru length of (phoneNumber)
else
set phoneNumber to ServicePrefix & phoneNumber
end if
make new phone at end of phones of person id personID with properties {label:phoneLabel, value:phoneNumber}
end repeat
end repeat
end tell
on cleanedUpNumber instead of oldNumber
set isPlus to (first character of oldNumber = "+")
set isIntl to ((characters 1 thru 2 of oldNumber) as string = "00")
--if isIntl then display dialog oldNumber & " is Intl"
set isInCountry to (first character of oldNumber = "0" and not isIntl)
--if isInCountry then display dialog oldNumber & " is in country"
set isUnknownType to not isPlus and not isIntl and not isInCountry
if isPlus then return "00" & characters 2 thru (length of oldNumber) of oldNumber
if isIntl then return oldNumber
if isInCountry then return "0041" & characters 2 thru (length of oldNumber) of oldNumber
if isUnknownType then return oldNumber
end cleanedUpNumber
The two dashes "--" make everything in the line after them a comment. That was for my debugging.
Also note that this will fail if there are anything but + or 0 as the first characters. One of my test subjects had (+44). That didn't work as I didn't try to code for it.

Similar Messages

  • Address Book Sync and SyncServices

    Anyone know what "Sync Services" are and why it keeps loading and running "Address Book Sync" and eating up 100% of my Intel CPU? What is this "syncing" with and why? Did my trial subscription to .Mac do this?

    Thank you for the quick answer. This looks like something that is programmed into the iLife suite of applications (Address Book, iCal, etc...). I can't find anything on my machine (via Spotlight) that suggest an application that manages this or allows you to turn it off.
    I think the reason for the high CPU utilization was my importing a 16,000 entry tab-delimited contact file into Address Book. I guess the Sync framework was busy distributing these new entries to all the other iWorks applications. It's quiet now, so I guess it launches itself when it sees the need to "sync-up" it's other member applications when data changes in one of them.
    Thanks again for the help!

  • I need to find a new email provider.  One that integrates well with my 'mail.'  I will also need to figure out how to notify everyone in my 'address book' of my change. I've been okay with earthlink but it's getting too expensive. Please advise.  Jack

    I need to find a new email provider.  One that integrates well with apple's 'mail.'  I will also need to figure out how to notify everyone in my 'address book' of my change. I've been okay with earthlink but it's getting too expensive. Can anyone help?  Jack

    I use a OLD G3 when I travel and mostly I am connecting over the satellites which is not really the best connection.
    I use GMX which is free and never have a problem getting my emails from anywhere even in the middle of the oceans.
    It does work using Apple mail and the adress book

  • Unsure of what happened to my address book, mail, and app store?

    My address book, mail, and app store are missing! Did they come with the computer when I bought it? (I have Mac OS X 10.6.8 and I bought it about 2 years ago) They all have different problems when I click on them. For starters, they three look like this in my app folder
    Then, when i click my address book, it comes out all smushed like this: ( i had to crop out much of the image due to personal information, but all information and links are smushed)
    The app store, when clicked, force quits immediately.
    & lastly, the mail will not even open. no blank screen, no force quitting apple message, nothing. infact, to quit the mail program, i have to force stop it myself.
    I really want to use these things and I just don't understand why they dont work, shouldnt they be included with my computer? that's the impression i was under, i didn't know i had to purchase the app store, mail, or address book? why wont they show up and what can i do to fix this?

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box. Don't use the Safari-only Guest login created by Find My Mac.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. The Guest login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, or if a firmware password is set, you can’t boot in safe mode.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • How can I delete ALL of my Address Book entries and start fresh?

    Yes. I know that sounds extreme, but……
    I use Outlook on a PC at my office, and I have an sbcglobal/Yahoo mail account. I look upon my office Outlook as my ultimate contacts list (over 1,100 entries) and my calendar.
    I use the sbc supplied free Intellisync software to sync all of my calendar and contacts from my office PC into sbc/Yahoo. That way I actually get e-mail reminders of appointments, etc. in addition to my Outlook notifications. It is actually pretty nifty.
    I have also successfully signed-on to my Yahoo account at home on my MAC and exported all of my contacts from Yahoo (which had been populated by the PC Outlook listings via Intellisync) onto my desktop and then imported them into Address Book. But I did that some time ago and now my Outlook listings have been updated rather substantially. I would like to able to do a complete re-install of the new and improved contacts from the Yahoo repository.
    Again - I certainly do not want to delete the Address Book app itself – I just want to start with a clean slate so there are no conflicts or duplicate entries (which in fact is seemingly a bug in the Yahoo/Intellisync. Is there a way to completely wipe clean all of my Address Book entries?
    Thanks
    Theo
    G4 (FW800) Mirrored doors Mac OS X (10.4.8) Dual 1.42GHz; 1.5GB DDR SDRAM; 20" HD Cinema Display; iSight;

    Hello Allan -
    Your help on a previous post was great re: my wanting to know how to delete the Address Book contents so I can re-import an updated list form my office Outlook, via my yahho/sbcglobal import.
    Well - here is an interesting quandary:
    I have successfully exported my yahoo address book/contacts as a .vcf file Yet - once I have expunged the prior Address Book data and want to now import the NEW Yahoo data to rebuild the database it only takes (enters) the phone numbers and does NOT import ANY of the address information. I am positive I did this once since our original exchange and everything transferred just fine, but now….?!
    What I cannot determine is where the fault may be: does the export NOT include the addresses (in which case I am doing something fundamentally stupid wit the export) or the vcf cards are complete, but Address Book is not “seeing” anything other than the phone #s and e-mail addresses.
    Any thoughts?
    Dazed and confused
    Theo

  • Lost my address book entries and current mail program.

    I recently installed Leopard on my G-4 and was not satisfied with it so I attempted to downgrade back to Tiger. In order to do this I had to reinstall Panther which I did, only I lost all my user settings, etc., even though I had checked the box to save. When my desktop appeared, my address book and mail program was empty. I backed up my mail program but have been unable to access my mail from 2007, only up to 2006. I went to Previous Systems, but again, only up to 2006. I have been all over my hard drive looking for my old address book but haven't found anything. Would my old address book still be there and if so, where? And how can I access my mail from 2007, even on the program that is backed up?
    Any help on these two topics is greatly appreciated.

    Hello Allan -
    Your help on a previous post was great re: my wanting to know how to delete the Address Book contents so I can re-import an updated list form my office Outlook, via my yahho/sbcglobal import.
    Well - here is an interesting quandary:
    I have successfully exported my yahoo address book/contacts as a .vcf file Yet - once I have expunged the prior Address Book data and want to now import the NEW Yahoo data to rebuild the database it only takes (enters) the phone numbers and does NOT import ANY of the address information. I am positive I did this once since our original exchange and everything transferred just fine, but now….?!
    What I cannot determine is where the fault may be: does the export NOT include the addresses (in which case I am doing something fundamentally stupid wit the export) or the vcf cards are complete, but Address Book is not “seeing” anything other than the phone #s and e-mail addresses.
    Any thoughts?
    Dazed and confused
    Theo

  • 5 crashes after upgrade to ios my address book immediately and I can not access emails, because the password is wrong and when I go to mail settings crashes the application immediately from

    5 crashes after upgrade to ios my address book immediately and I can not access emails, because the password is wrong and when I go to mail settings crashes the application immediately from 

    Same issue also. Occurring both on my iPad 2 and iPhone 4 after upgrading to ios 5
    By the way, Mattban and Sancasslano, are either of you also experiencing any of the following issues:
    * Problems with Contacts either crashing or listing no names
    * Problems with turning iCloud on or off for application under Settings->iCloud... On both mine I just get a pop up saying that iCloud is being turned off but Contacts then just locks up.
    * General problems when trying to synch applications on the iPad or iPhone over iCloud?
    I am wondering if all these issues are in someway related to and whether it is worth trying to turn off iCloud somehow, though I cannot work out how this can be done once set up.

  • How to Sync Address Book, iCal and Safari bookmarks with Blackberry Storm

    I recently purchased a Blackberry Storm and have been trying to sync my Address Book, iCal and Safari bookmarks without any luck. I downloaded the PocketMac SyncManager from BlackBerry but the sync fails when I connect the Storm to my MacBook Pro. Any suggestions as to how one gets this to work?

    I read that Mark/space had problems and wasn't working very good..
    http://discussions.apple.com/thread.jspa?threadID=1792905&tstart=0
    Though I did see a thread using Google mail -Take a look at that .
    http://discussions.apple.com/thread.jspa?messageID=8660300&#8660300
    Brad

  • HT4910 I tried to update my address book on OS X6 with an abbu from my other computer which has Lion OS X 7.  It wiped my address book clean and I cannot retreive by Address book on my OS X 6 computer and saves out there?

    I tried to update my address book on OS X6 with an abbu from my other computer which has Lion OS X 7.  It wiped my address book clean and I cannot retreive by Address book on my OS X 6 computer and saves out there?

    blacksheepfibers wrote:
    I updated my mac with  os x Lion so that I could accomplish moving my address book from the mac to my new IPad 3G. I also set up an icloud account for this purpose, but I *still* cannot figure out how to move my address book from one computer to the other. When I'm on my mac and try to use bluetooth to export the address book, I'm able to find my ipad but I soon get a message that it does not support the necessary services. I have no idea what's going on and would appreciate any advice. tks in advance, Sarah
    The address book syncs via iCloud, not Bluetooth or iTunes.
    You upgraded to Lion so you could use iCoud.
    On the computer. go to Apple menu > System prefs > iCloud.
    Sign into your iCloud account.
    Tick everything.
    This enalbes the se items syncing to iCloud.
    On the iPad, Settings > Mail, Contacts, Calendars.
    Create a new iCloud account.
    Sign in with the same AppleID as your computer.
    Settings > iCloud and turn everything on.
    BAM!
    That is all you need to do.
    Your contacts (and all other checked items checked) will sync between computer and iPad.
    No need to use iTunes

  • Address Book, iCal and Gmail

    I would like to make Gmail my default source for Address Book entries and iCal entries on my Intel Mac running Lion and my iPad. There seems to an 'almost' option in Address Book when setting up for Gmail, however, it only states my mac

    I have heard a lot about how the new 2.0 software will work with Microsoft exchange, but i have heard nothing about how it will work with ical and address book, or if gmail users will get any added email benefits.... so someone please give me some good news....
    How it will work with iCal and Address Book in what way? With over the air syncing?
    If so, only with Apple's new Me.com service which is replacing their .Mac service. This will provide over the air syncing for contact information and calendar events between iCal and Address Book on a Mac, with the iPhone, and when accessing your Me.com account via Safari on any Mac, or with Safari or a supported browser on a Windows PC. The Me.com account will be push email.
    Regarding any added benefits for a Gmail account, I don't believe so, unless Gmail plans on adding some benefits such as push-IMAP account access.

  • Address book freezes and loses cards

    While entering a new card, the address book froze and after forcing quit, all the cards were gone. Fortunately most were back-upped. Any ideas, an Intel virus perhaps, that's a joke.
    Jim Easton
    Power Book Pro   Mac OS X (10.4.5)  

    Hi,
    I followed your suggestions from the thread linked below, unfortunately it didn't do the trick... I just lost a no backup addressbook after the compter froze while entering a new contact. I'm hoping the corrupt/lost file is floating somewhere, waiting for me to dig it up. What do you think? Thanks!
    G5 Dual 1.8gHz; Powerbook G4 1.5gHz   Mac OS X (10.4.6)  

  • Address book app and Addresses pane in Mail not synced

    Address book app and Addresses pane in Mail not synced
    I add a contact to Address Book app eg [email protected], this address is not imediatley available to use in Apple Mail app.
    The address [email protected] eventually appears in the Address panel in Maill app, it can take from 3 minutes to hours to appear, surely both apps are reading the same database.
    This is particularly problematic when adding new contacts to groups and then emailing that group, Im never sure the group in Mail app is the same as the group in Address Book app.
    Nothing seems to speed up this process ie quitting and re-opening Mail app or Address book app.
    I have tried deletting "AddressBook-v22.abcddb" ~/Library/Aplication Suport/Address Book
    I have tried forcing ~/Library/Aplication Suport/Address Book to re-index.
    I have also restarted, repaired permissions, ran fsck -fy in single user mode.

    Because the sender has their name as part of the email address that is sent, and when they send you a message that matches the one in your Address Book, it's updated to show their name as Mail received it. But if you had previously sent them email before that update occurred, then your Previous Recipients database in Mail doesn't use that newly updated information in Address Book.
    Mulder

  • Font book is sick and causing Address Book, Safari, and Mail problems

    Address Book, Mail, and Safari will only run if I have Font Book open. If I try to open the programs without opening Font Book they don't appear and I have to Force Quit and reopen after opening Font Book.
    I run a publishing company and load and unload lots of fonts to Font Book. I guess its something I loaded recently because I now have the problem on both the computers I work on. I have no idea which fonts might be causing the problem.
    What can I do?

    Hello Dave,
    If you've already tried cornelius' suggestion and wound up in the same place, then you've likely added a corrupt font or two to those two Macs. While the steps to clean up Font Book are correct, a bad font will immediately corrupt the new Font Book database when loaded.
    So try this. Create an empty folder on your desktop and move all of the fonts you added to those Macs to the empty folder. Then perform the funtion to clean up font book again. Lastly, download and run Mark Douma's Font Finagler to clear the font cache files on the system, since they will also be damaged.
    If that clears things up, then use Font Doctor to examine your fonts in the temporary folder on your desktop to repair them (if possible) before adding them back to the system.

  • Moving Safari bookmarks, address book info and mail messages to new machine

    I recently got a new powerbook and would like to transfer my safari bookmarks, mail messages and address book information over to the new machine. What would be the best way to do this? I'd like to keep the old information on the desktop and simply add the information to the new machine.

    Yeah - but the kicker is, I don't want to transfer everything, just the safari bookmarks, the address book information and selected mail folders that are "On My Mac"

  • HT4759 Address book hacked and virus problem since using iCloud

    Had my address book hacked, and virus emails sent to all since using icloud.  Help!! none available on line!

    You're posting in the "iCloud on my Mac" forum, but your profile just says "PC"... are you accessing iCloud from a Mac or a PC? If it's a PC, they get hit by viruses that do this sort of thing all the time. If you're using a Mac, it's almost certainly not malware of any kind. In the latter case, see Someone is sending messages from my e-mail address!

Maybe you are looking for

  • Help ~~ Cannot compile servlet program

    I have recently written a servlet program. When I compile the program (let's say "HelloWorld.java"), I've got the following error message: package javax.servlet does not exist I've download the class files and set the classpath already. Have I missed

  • IPhone 3G screen problem? Potentially?

    I dont know if this is an issue or not, but I've just noticed this. My iPhone's screen appears to have a border runnign around it of two or three blank pixels. It runs right the way around the edge of the screen. The main image the screen projects sh

  • Digital Camera Memory Card Reader

    Is there a device that I can plug into my computers USB port and transfer pictures from my cameras memory card to my computer..  I also have a Motorola Razor phone that I would like to transfer photos from to my computer, is there a device for that.

  • Browser Refreshing

    I notice when building Flash sites on my Mac usually using Safari, that when I upload an updated SWF that I usually have to manually refresh the browser and/or dump the browser cache before I can see the revised file(s) immediately. I have two relate

  • Monitor a session

    I have a java application running at the front end. The user logs into the java application and access the data. I have user complaining regarding slow response of application(not always but atleast 2 to 3 times in a day while she is working) Since t