[R-SIG-Mac] Execute code to the GUI R.app from Smultron or BBEdit

Guillaume Chapron carnivorescience at gmail.com
Mon Dec 29 02:18:36 CET 2008

> Hi,
> Check out these recent threads:
> TextWrangler:
> https://stat.ethz.ch/pipermail/r-sig-mac/2008-November/005534.html
> Smultron:
> https://stat.ethz.ch/pipermail/r-sig-mac/2008-December/005691.html
> -steve


Thanks a lot - apparently I did not search well in the archive. I will  
just post a recap here for BBEdit in case some people want to do it as  

*Open Script Editor (located in Applications/AppleScript)
*File-> new script
*Paste this (modified from Jean Thioulouse code for TextWrangler on  
this list):

tell application "BBEdit"
	set the_selection to (selection of front window as string)
	if (the_selection) is "" then
		set the_selection to line (get startLine of selection) of front  
window as string
	end if
end tell
tell application "R"
	cmd the_selection
end tell

Save this script into this directory
~/Library/Application Support/BBedit/Scripts/

In BBEdit go to the menu Windows -> Palettes->Scripts
Your script should be visible there, and you can set a key to run it.

Thanks again


More information about the R-SIG-Mac mailing list