[R-SIG-Mac] any way to tell R.app to clear console (other than simulating cmd-option-L)?

Hans-Jörg Bibiko bibiko at eva.mpg.de
Tue Jul 5 20:13:03 CEST 2011


On 5 Jul 2011, at 19:58, Timothy Bates wrote:

> I’d like to send an applescript command to R.app (from Textmate) to clear the console (as is achieved by “Edit:Clear Console”)
> 
> Is there an R function that achieves that, or calls R.app’s menu items?

Hi Tim,
simply call this AppleScript which sends the key equivalent ⌥⌘L to R.app

tell application "R"
	activate
	tell application "System Events"
		keystroke "l" using {command down, option down}
	end tell
end tell

Cheers,
--Hans

**********************************************************
Hans-Joerg Bibiko
Max Planck Institute for Evolutionary Anthropology
Department of Linguistics
Deutscher Platz 6     phone:   +49 (0) 341 3550 341
D-04103 Leipzig       fax:     +49 (0) 341 3550 333
Germany               e-mail:  bibiko[-at-]eva.mpg.de



More information about the R-SIG-Mac mailing list