-1

I would like to build a shortcut for Sweave's chunck when I am writting R code. I use Textwrangler and I am pretty sure I can do it with an Apple script but I know very few of it.

The idea would be to add where my cursor is :

<<options, >>= @

Does anybody could help me ?

maazza
  • 7,016
  • 15
  • 63
  • 96
  • You probably don't need the `r`, `applescript` or `sweave` tags. It sounds like you want to create snippets; most text editors support this. – Phil Dec 17 '15 at 13:40
  • Maybe some other people would like to add sweave chunk with a shortcut,that is why I put the tags. Anyway, snippets keyword help me, thank you !! Here the answer : [link](https://groups.google.com/forum/#!topic/textwrangler/UExtz0JhQ_Y) – user1997740 Dec 17 '15 at 13:58
  • Glad you found an answer. Consider posting it as an answer to this question and accepting it, so others can see how this issue was solved? – Phil Dec 17 '15 at 14:01
  • Adding this applescript to TexWrangler works perfectly for me ! – user1997740 Dec 30 '15 at 08:23
  • I have found the answer here [link](https://groups.google.com/forum/#!topic/textwrangler/UExtz0JhQ_Y) – user1997740 Dec 17 '15 at 14:16

1 Answers1

0
tell application "TextWrangler" to activate
tell application "System events"
    keystroke "<<options, >>= "
    keystroke return
keystroke "@"
end tell

Just run this script