This AppleScript is useful

10 Sep 2007 by Christian Eager

I know everyone’s really excited to hear more about AppleScript and data entry. Sorry, this post isn’t it. Data entry is done, but now I want to cull those who gave email addresses from those who gave snail mail addresses, for a couple of reasons. Googling didn’t lead me to believe that this had been done before (publicly), so I wrote a little script:

-- email_cull.scpt 
tell application "Address Book"
    try
        set thePeopleList to people in group "FullMailingList"

        repeat with thePerson in thePeopleList
            if number of emails of thePerson is greater than 0 then
                add thePerson to group "EmailList"
            end if
        end repeat

        save addressbook

    end try
end tell

As you can see, the values for the full mailing list and target list are hard-coded, and the target list must exist before running the script. I’ll leave arbitrary source and target lists as an exercise to you, dear Reader. In the meantime, I’ll keep you posted (pun intended) with AppleScript snippets.


« Accountability & the FBI
» Media
Copyright © 2008 Perpenduum. All rights reserved.