Message-ID: <33A6D224-5825-4533-A48F-B1BA2BA9BDE9@ed.ac.uk>
Date: 2011-07-06T11:17:32Z
From: Timothy Bates
Subject: any way to tell R.app to clear console (other than simulating cmd-option-L)?
In-Reply-To: <2DE214FA-15A3-4750-8E77-B7A163CC3C28@eva.mpg.de>
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)
~/Library/Services
--
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
cheers,
tim
Timothy Bates
Professor of Individual Differences in Psychology
University of Edinburgh
7 George Square EH8 9JZ
+44.131 651 1945