Skip to content

Instantly share code, notes, and snippets.

@kristarella
Created March 7, 2013 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristarella/5104539 to your computer and use it in GitHub Desktop.
Save kristarella/5104539 to your computer and use it in GitHub Desktop.
Somewhere along the way in syncing and merging duplicate contacts etc. I ended up with boat loads of Google Profile links as people's home page in my contacts. Most of those people don't even use Google+, so it seemed a bit dumb. This script easily vamoosed them! Don't forget to change the conditional contains "google.com" if you want to remove …
tell application "Address Book"
set output to ""
repeat with this_person in every person
set numurl to count (urls of this_person)
if numurl > 0 then
set theurls to properties of urls of this_person
repeat with this_url in theurls
-- Capturing the urls and a new line
set output to output & (value of this_url as string) & return
if value of this_url contains "google.com" then
set value of url of this_person to ""
end if
end repeat
end if
end repeat
display dialog output
save
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment