[TxMt] Matlab bundle

Thomas Aylott - subtleGradient textmate at subtleGradient.com
Mon Dec 17 20:09:11 UTC 2007


On Dec 17, 2007, at 2:27 PM, Miguel Vaz wrote:

> Btw, a colleague of mine did his "link" with something called  
> HotKeys (I think) in windows.
> He defined a macro for pasting the selected text in his editor  
> directly in the matlab window.
> No idea, though, how to make this in os x.

Sounds like a job for…
         Applescript UI Scripting.

I have a handy command that takes the current selection and pastes it  
into the terminal.
         (not directly attached since it is so incredibly dangerous)

Input: Selection or Document
Output: Tooltip


         pbcopy
         osascript -e 'tell application "Terminal" to activate' \
                 -e 'tell application "System Events"' \
                         -e 'tell application process "terminal"' \
                                 -e 'delay 0.1' -e 'keystroke "k"  
using command down' \
                                 -e 'keystroke "v" using command down' \
                         -e 'end tell' \
                 -e 'end tell' \
                 -e 'tell application "TextMate" to activate'
         echo "Selection Sent to Terminal"


That might be convertible for whatever. I made one similar for doing  
Second Life code.
	(I have a whole Second life bundle, if anyone is interested.)

—Thomas Aylott – subtleGradient—


More information about the textmate mailing list