It looks like I was over-thinking it. I didn't realize you _only_
needed to handle the case when you were at the end of a line. I was
thinking of vim's command that will create a new line below/above your
current position, no matter where your cursor was currently at on a
line. The scripts I gave
Am 19.01.2011 um 00:09 schrieb Watts Martin:
I'm working on a little AppleScript that replicates a trivial but
cherished feature of another editor -- being able to press Ctrl-Return
(or whatever) and having it start the new line with an appropriate
indent.
My script does the right thing
I'm working on a little AppleScript that replicates a trivial but
cherished feature of another editor -- being able to press Ctrl-Return
(or whatever) and having it start the new line with an appropriate
indent.
My script does the right thing now as long as there's nothing on the
line below where
System events are certainly the easier (shorter) way to do it:
---
tell application BBEdit to tell front window
activate
tell application System Events to keystroke end
tell application System Events to keystroke return
tell application System Events to keystroke
I'm working on a little AppleScript that replicates a trivial but
cherished feature of another editor -- being able to press Ctrl-Return
(or whatever) and having it start the new line with an appropriate
indent.
My script does the right thing now as long as there's nothing on the
line below where