* Brett Terpstra brett@circlesixdesign.com [2006-11-07 15:20]:
This one exits properly if there is only one address found.
Very nice! Passing a list of lines to Ruby is exactly what I was thinking of. Dropping an osascript call in there should be easy... once I come up with a good one.
I fixed the sorting by adding -s to the contacts call and not reversing 'names'.
Hitting escape from the menu removed the original text. I changed that by using TextMate.exit_replace_text(search_text). Is there a way to make this work with abort? Replacing the text with itself is a bit of a kluge.
Finally, what's the best way of setting the path? I have contacts in /opt/local/bin, and I guess TextMate doesn't call bash_init.sh for /usr/bin/env scripts.