Almost the first word that Tim said when I told him I was also a Mac user was “Textmate“! I used to use jEdit as text editor to write my do files (also compatible with Windows) but his enthusiasm convinced me I should try.
Textmate is an exclusive text editor for Mac. Among its great features are syntax highlighting colors, great project management options, foldable code bloks, column selection, … etc. I will let Tim tell you more about it in a future post and will just explain here in details how to use it instead of the Stata do file editor.
First of all install Textmate (30-day free trial version). Then, you should download the bundle that Tim wrote some years ago (Thanks Tim!). To install the bundle, ctrl+click on the Textmate.app (that you should have put in your application directory) and select Show Package Contents in the drop down menu and then Contents –> SharedSupport –> Bundles and drag the Stata bundle in the bundles file.
Finally, you may have to edit the bundle if you don’t have the StataMP version (for example StataSE). To do so, open Textmate and go to to Bundles –> Bundle Editor –> Show Bundle Editor –> Stata
You should see this:

We are almost there… If you have like me the SE version, just replace StataMP by StataSE in “Send File to Stata” and in “Send Selection to Stata”.

Here you go!
Just one more comment about how the Stata bundle works by default: the “Send File to Stata” command does not create any file as it directly runs the do file on which you are working, but the “Send Selection to Stata” creates a do file called textmatetostata.do in the file directory of the do file on which you are working and changes Stata directory to this directory. This may be problematic if the location of your do file is not your default Stata directory. One way to solve the problem is to save directly the textmatetostata.do in the same directory as your default directory in stata.
echo “$TM_SELECTED_TEXT” > “{STATAdirectoy}/textmatetostata.do”
and
open POSIX file \”{STATAdirectoy}/textmatetostata.do\”
For example in my case I have:

Have fun with Textemate!
Laure