I have a thing about shooting out emails and then remembering a bug I forgot to check for. I apologize.
This one exits properly if there is only one address found.
Brett
* 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.
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'm interested to see what you come up with there. I'm experimenting, but haven't come up with an elegant solution yet.
I fixed the sorting by adding -s to the contacts call and not reversing 'names'.
I forgot the reverse was in there from earlier experiments, so sorry about that.
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.
TextMate.exit_discard seems to work fine.
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.
<Find Email Address in Address Book.tmCommand>
As far as the path goes, I think TM ignores the init when there's a shebang[1]. It requires editing\creating ~/.MacOSX/ environment.plist. Not sure there's an elegant solution for that... unless, of course, we could put contacts into the support folder for the bundle and call it from there ;->.
Brett [1]http://macromates.com/textmate/manual/shell_commands