I've been going crazy with Address Book lately -- ever since I started to Sync with Mobile Me. One thing I've been doing is creating Smart Group, but I've run into some pretty buggy behaviors; this was especially true for rules. I eventually discovered that the most reliable thing to do is to use one rule that looks for a special string in the Note field. However, adding that string to each card's Note field can be tedious, and I wanted to do this repeatedly for tons of cards, so I struggled with AppleScript until I had the following solution.
display dialog "Enter value to append to Notes of selected Address Book Cards" default answer "" buttons {"Cancel", "OK"} default button 2
set the append_string to the text returned of the result
tell application "Address Book"
activate
set thePeople to selection
repeat with thePerson in thePeople
set noteValue to note of thePerson
try
set theLastCharPos to length of noteValue
on error
set noteValue to ""
set theLastCharPos to length of noteValue
end try
if theLastCharPos is greater than 0 then
set theCharacter to character theLastCharPos of noteValue
if "
" contains theCharacter then
set newNoteValue to noteValue & append_string
else if theLastCharPos is greater than 1 then
set newNoteValue to noteValue & ";" & append_string
else if theLastCharPos is equal to 1 and " " contains theCharacter then
set newNoteValue to append_string
else
set newNoteValue to noteValue & ";" & append_string
end if
else
set newNoteValue to append_string
end if
set note of thePerson to newNoteValue
end repeat
end tellMac OS X Hints
http://hints.macworld.com/article.php?story=20100318152934603