ml
Mark line

Script key: Mark line

Posted by Alexader Seidl, @a_aladin1001

Install

Details

Label ml
Voice Over Mark line
Script
var selRange = getSelectedRange();
var mark_start, mark_length

var text = getText();
var beforeText = text.substring(0, selRange[0]);
var afterText = text.substring(selRange[0]);

var beforeText_indexOfn = beforeText.lastIndexOf("\n")
var afterText_indexOfn = afterText.indexOf("\n")


if (beforeText_indexOfn < 0) {
  beforeText_indexOfn = 0
  mark_start = beforeText_indexOfn
} else {
  mark_start = beforeText_indexOfn + 1
}

if (afterText_indexOfn < 0) {
	afterText_indexOfn = text.length
    mark_length = afterText_indexOfn-mark_start
} else if (afterText_indexOfn == 0) {
  	afterText_indexOfn = 1
    mark_length = afterText_indexOfn
} else {
  	mark_length = afterText_indexOfn+(selRange[0]-mark_start)
}


if (mark_length <= 0) {
  mark_length = 1
  mark_start -= 1
}

setSelectedRange(mark_start, mark_length)
//setSelectedText("")

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus