September 20th, 2008

Processing and TextMate in sweet harmony

Processing is a great tool, but to be honest, the code editor could be better. Fortunately there is an easy way to integrate it into TextMate.

Here is what you do:

  1. Install the Processing bundle via GetBundle.

  2. It works pretty well until you want to run your code in Processing. The command “Run in Processing” seems not to work. To fix it, open up TextMate’s the Bundle Editor and modify the command to the following:

osascript <<EOF tell application “Processing 0148″ to run tell application “Processing 0148″ to activate tell application “Processing 0148″ to open POSIX file “${TM_FILEPATH}” delay 1 tell application “System Events” to tell process “Processing” keystroke “h” using command down keystroke “r” using command down end tell EOF

Get sure to replace Processing 0148 with the build number of your version. What this piece of code does is actually pretty simple: It tells the Processing application to open the file that’s currently opened in TextMate and invokes the keystrokes Command+H (to hide the processing window) and Command+R (to run your program in Processing). 

  1. Now, when you hit Command+R, Processing opens and compiles your code. 



2 Responses to “Processing and TextMate in sweet harmony”

  1. coocoo says:

    http://www.onebitwonder.com/projects/processing/ <– bundle compiles and runs .pde directly without having to open processing application

  2. I bookmarked this guestbook. Thank you for really well position! .

Leave a Reply