I have 2500 contacts, most of my email addresses are labeled “Email”, however the .mac address book only shows the email addresses if they are labeled “Home” or “Work”
Can anybody come up with a script to change all email field labels from “Email” to “Work” or “Home”
Model: Macbook Pro
Browser: Safari 522.12.1
Operating System: Mac OS X (10.4)
I had a similar script to this for phone labels lying around. With a few modifications:
----
-- Change Address Book's Email Labels
-- John Maisey
-- 9 September 2007
--- http://www.nhoj.co.uk
-- From similar script written for phone labels 27 May 2005
set theOld to "email" -- label to replace
set theNew to "work" -- new label
tell application "Address Book"
--to mark time taken
set startTime to (current date)
-- get people whose email labels contain the old term
set thePeople to (get every person whose label of emails contains theOld)
-- loop through these people
repeat with aPerson in thePeople
-- loop through email entries with the old term
repeat with myEmail in (emails of aPerson whose label is equal to theOld)
-- set the label to the new label
set the label of myEmail to theNew
end repeat
end repeat
-- to refresh
save addressbook
--to mark time taken
set takenTime to (current date) - startTime
-- Display confirmation
display dialog "All \"" & theOld & "\" changed to \"" & theNew & "\"." & return & (count thePeople) & " records changed" & return & "in " & takenTime & " seconds." as string buttons {"OK"} default button 1 with title "Change Email Label Script" with icon 1
end tell
Change the lines starting “set theOld to” and “set theNew to” to what you want.
.
-- loop through email entries with the old term
repeat with myEmail in (get emails of aPerson whose label is equal to theOld)
-- set the label to the new label
set the label of contents of myEmail to theNew
.