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: rsnyder on Dec 19, '04 12:42:13AM

How would you modify the script to allow it to be used when the Zip is either null or = 5 digits. So that you can use the tool to find the Zip + 4 when you only have the short Zip code?

Right now I remove the short zip, click edit off, then the script becomes active. I am sure someone with more AppleScript experience can point me in the right direction.



[ Reply to This | # ]
ANSWER: Check for Zip +4 with only ZIP
Authored by: rsnyder on Dec 20, '04 10:02:23AM
Ok, so I'm answering my own question.

Provided you strictly follow the convention of using a hyphen in your Zip + 4 entries (e.g. #####-####) the following minor changes will allow you to look up the full Zip plus four even if you already have a five digit Zip in the field.

First, change the first part of the section for naming the action title to:
on action title for p with e
if zip of e contains "-" then
return "Zip Code Present"

Then change the first part of the section that enables the action title:
on should enable action for p with e
if zip of e does not contain "-" then
return true


[ Reply to This | # ]