Message-ID: <2DE214FA-15A3-4750-8E77-B7A163CC3C28@eva.mpg.de>
Date: 2011-07-05T18:13:03Z
From: Hans-Jörg Bibiko
Subject: any way to tell R.app to clear console (other than simulating cmd-option-L)?
In-Reply-To: <F91887B8-286B-4DD1-BB1A-5F0592AB3D98@ed.ac.uk>
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