1️⃣
Delete all but the first line.

Script key: Delete all but the first line.

Posted by odornd

Install

Details

Label 1️⃣
Voice Over Delete all but the first line.
Script
// Script keys run short Javascripts
// For documentation and examples, visit:
// http://help.agiletortoise.com

// *************
//This key removes all text after the end of the first line and positions the cursor on the second line, ready to insert text
// *************

// move cursor to beginning
setSelectedRange(0,0);

// find the range of the first line
var firstLineRange = getSelectedLineRange(0,1);

// length of the whole draft
var length = getText().length;

// reset length to just the portion of the draft after the first line
length = length - firstLineRange[1];

// clear all text after first line
setTextInRange(firstLineRange[1], length, "");

// move cursor to second line
setSelectedRange(firstLineRange[1],0);

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus