Created
March 3, 2015 01:26
-
-
Save luhui/84fd88598b55c5c4f225 to your computer and use it in GitHub Desktop.
An apple script that transform the email address in contacts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tell application "Contacts" | |
| repeat with i from 1 to (count every person) | |
| set theEmailAddresses to properties of emails of person i | |
| repeat with j from 1 to (count of theEmailAddresses) | |
| if value of item j of theEmailAddresses contains "@cvte.cn" then | |
| set oldAddress to value of item j of theEmailAddresses | |
| set AppleScript's text item delimiters to {"@"} | |
| set firstBit to first text item of oldAddress | |
| set newAddress to firstBit & "@cvte.com" | |
| set value of item j of emails of person i to newAddress | |
| end if | |
| end repeat | |
| end repeat | |
| save | |
| end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment