[TxMt] Re: R send function to console

Hans-Jörg Bibiko bibiko at eva.mpg.de
Wed Mar 5 11:29:42 UTC 2014


… oops, sorry, much more easier ;)



Create a new tmCommand with:
----------------------------------------
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"


Rcmd="length($TM_SELECTED_TEXT)"

osascript <<-APPLESCRIPT
tell application "R" to cmd "${Rcmd//\"/\"}" 
APPLESCRIPT
----------------------------------------

Input: Selection; format: Text
Output: Discard
Key Equivalent: "whatever you like"



More information about the textmate mailing list