Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Add a zip code lookup to Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add a zip code lookup to Address Book
Authored by: aschmidtm on Nov 29, '04 08:35:46PM

How about a reverse lookup to populate city by input of a zip code?

---
&nbsp[-[-[A]-]-]
SUBARU



[ Reply to This | # ]
Add a zip code lookup to Address Book
Authored by: disappearinjon on Nov 30, '04 07:09:25PM
Here you go!
-- zip code reverse lookup
using terms from application "Address Book"
	on action property
		return "address"
	end action property
	
	on action title for p with e
		if city of e is missing value or state of e is missing value then
			return "Look up city and state"
		else
			return "City and State set"
		end if
	end action title
	
	on should enable action for p with e
		if ((zip of e is not missing value) and ((city of e is missing value) or (state 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/zip_responseA.jsp?Selection=3&zipcode=" & zip of e
		tell application "Dock" to open location LookupURL
		return true
	end perform action
end using terms from


[ Reply to This | # ]