Jump to the end of the line and then the beginning.

Script key: Jump to the end of the line and then the beginning.

Posted by Med0paW

Install

Details

Label
Voice Over Jump to the end of the line and then the beginning.
Script
// Script keys run short Javascripts
// For documentation and examples, visit:
// http://help.agiletortoise.com

var pos = getSelectedRange()[0];
var line_range = getSelectedLineRange();
var begin = line_range[0];
var len = line_range[1];
var end = begin + len;
var total_end = getText().length;
if (end != total_end) {
  end -= 1;
}

if (pos == end) { // at end. go to begin
  setSelectedRange(begin, 0);
} else { // go to end
  setSelectedRange(end, 0);
}

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus