find email address in address book (was Re: [TxMt] Sorry)

Brett Terpstra brett at circlesixdesign.com
Wed Nov 8 00:45:18 UTC 2006


> 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





More information about the textmate mailing list