Search code examples
dnsapplescriptcontactsaddressbook

How to delete all email addresses with a specific domain in OS X Contacts using AppleScript?


I have a bunch of email addresses in my contacts that are the email addresses of their phone number provided to them from Verizon.

For example:

1234567890@vtext.com or 

I want to create an Applescript that deletes all of those email addresses.


Solution

  • I haven't tried pbell's answer, but the script below worked for me.

    tell application "Contacts"
        tell every person
            delete (every email whose value contains "vtext.com")
        end tell
        save
    end tell