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

Timothy Bates tim.bates at ed.ac.uk
Wed Jul 6 13:17:32 CEST 2011

Thanks Hans!
I was hoping to avoid relying on simulating keypresses and the consequent context switch.

but it does the trick, so. 

osascript -e 'on run(theCode)' \
          -e 'tell application "R64" to activate' \
          -e 'tell application "System Events" to keystroke "l" using {command down, option down}' \
          -e 'tell application "TextMate" to activate' \
	  -e 'end run’

Probably best saved as a workflow, to reduce dependency on one editor.
So, as a Services workflow (to install in the new and improved OS X services system)

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: R clear console.workflow.zip
Type: application/zip
Size: 53651 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20110706/a1f4ca5d/attachment-0001.zip>
-------------- next part --------------

On 5 Jul 2011, at 7:13 PM, Hans-Jörg Bibiko wrote:

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


Timothy   Bates
Professor of Individual Differences in Psychology
University   of   Edinburgh
7 George Square EH8 9JZ
+44.131 651 1945

More information about the R-SIG-Mac mailing list