[TxMt] Sending command to R

Alan Schussman alan at schussman.com
Mon Apr 17 21:18:09 UTC 2006


I'm using TextMate a lot these days to write code for R and I'd like  
to see if there's a way to make an improvement.

The existing command in the R bundle works fine as long as I'm  
sending just a handful of lines to the R application, but TextMate  
gives me the beach ball for as much as a minute when I send lots of  
code over, and then suddenly dumps all the code into R. For  
reference, here's the short R command:

osascript -e 'tell application "R" to activate' -e "tell application  
\"R\" to cmd \"${TM_SELECTED_TEXT//\"/\\\"}\""

I'm guessing that TM itself doesn't have a problem with the amount of  
text, and that the bottleneck is in the applescript. Is there any way  
to speed up how this is done in the event of a large set of commands?  
For example, could the command be split into an array and run line-by- 
line? (Would this result in an increase in speed? I have no idea --  
just thinking out loud.)

Thanks for suggestions. Cheers-
-Alan





More information about the textmate mailing list