Add a zip code lookup to Address Book

Nov 29, '04 09:37:00AM

Contributed by: disappearinjon

I modified the Burger Locator script for Address Book to look up zip codes from the U.S. Post Office's Web site. Here's the modified version:


-- zip code locator
using terms from application "Address Book"
  on action property
    return "address"
  end action property
  
  on action title for p with e
    if zip of e is not missing value then
      return "Zip Code Present"
    else
      return "ZIP + 4 Lookup "
    end if
  end action title
  
  on should enable action for p with e
    if zip of e is missing value then
      return true
    else
      return false
    end if
  end should enable action
  
  on perform action for p with e
    set LookupURL to ¬
      "http://zip4.usps.com/zip4/zip4_responseA.jsp?Selection=1&address1=" ¬
      & street of e & "&city=" & city of e & "&state=" & state of e
    tell application "Dock" to open location LookupURL
    return true
  end perform action
end using terms from
You can also find the original, along with some discussion, here on my site.

[robg adds: Refer to the linked original hint for instructions on how to add this script to Address Book.]

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20041126220328786