[TxMt] How do I tell TextMate to move the cursor one line down?

Tobias Pyndt Steinmann tobii at tobii.dk
Sat Oct 4 16:12:13 UTC 2008


Hi,
I am trying add a command to the R bundle that will send the current  
line to the R GUI, in the same way the ESS for Emacs "Eval line &  
step" command works.
It is quite easy to send the line to R GUI, but I cannot find a good  
way to move to the cursor to the next line in TextMate.
Currently I am using this Applescript to do the job:
# move the cursor
osascript -e 'tell application "System Events"' \
		 -e 'tell application "TextMate" to activate' \
		 -e 'tell process "TextMate"' \
		 -e 'keystroke (ASCII character 31)' \
		 -e 'end tell' \
		 -e 'end tell'

But the problem is that when you call the command using a keyboard  
shortcut ie. cmd+shift + R and keep holding cmd+shift for some time (I  
have this of a habit unfortunately :) ) the keystroke will be cmd 
+shift + (ASCII character 31) causing the text from the cursor to the  
end of the document to be selected.

Is there a smarter way to advance the cursor one line? -- maybe an  
internal TextMate command?

Thanks in advance.
with best regards,
Tobias Pyndt Steinmann

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1929 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20081004/d2c2f454/attachment.p7s>


More information about the textmate mailing list