tell application "Address Book"
repeat with oneperson in (get people whose note contains "(Priority)")
set {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "(Priority)"}
set n to text items of (get note of oneperson)
set AppleScript's text item delimiters to ASTID
set note of contents of oneperson to n as text
end repeat
end tell
How would I modify this script to have it remove ALL the notes? I imported my address book from yahoo, and it placed a bunch of nonsense in the notes filed of each contact. with about 340 contacts, would be nice to have this work for me as well.
I am looking for a way to add text to multiple AB record note fields without having to copy and paste each one. For example, if I create a group called “My Contacts” and there are 250 records in that group, and I want to add the “sent Christmas Card email 2009” to each note field, is there a way to add the phrase to each note field of the group?
I had been using an Applescript that worked very well. But every since I installed SL 10.6, it doesn’t work anymore. Perhaps the script needs to be altered? If so, how? Here is the script I was using:
tell application “Address Book”
set AppleScript’s text item delimiters to {“Sent Christmas Card Email 2009”}
set TheList to every person of group “My Contacts”
repeat with Who in TheList
if note of Who is not missing value then
set NewNote to note of Who & return & “Sent Christmas Card Email 2009”
set note of Who to NewNote
else
set note of Who to “Sent Christmas Card Email 2009”
end if
end repeat
end tell
tell application "Address Book"
repeat with k from 1 to count of people in group "My Contacts"
set theChoice to "Sent Christmas Card Email 2009"
set currentNote to the note of person k
set newNote to (currentNote & return & theChoice)
if currentNote is missing value then
set note of person k to theChoice
else
set note of person k to newNote
end if
end repeat
save
end tell
I’m currently working with notes in addressbook and I came by this link at macosxhints, which adds the ability to batch add a note to the currently selected addressess. Beware the script uses “;” as its text item delimiter.
This should delete all the notes of all selected persons. Use it at your own risk.
There are plenty of script out there, which deletes Entourages junk.
-- Deletes every note of every person in the address book
-- take a backup first or be sure that you know what your are doing
-- Executing this script is your own responsiblity.
tell application "Address Book"
activate
set thePeople to selection
repeat with thePerson in thePeople
set note of thePerson to ""
end repeat
end tell
tell application "Address Book"
activate
set thePeople to selection
repeat with thePerson in thePeople
set note of thePerson to ""
end repeat
save
end tell