Child
New line with 1 further tab indent

Script key: New line with 1 further tab indent

Install

Details

Label Child
Voice Over New line with 1 further tab indent
Script
drafts = this;

var	lstRange = drafts.getSelectedLineRange(),
	iSelnStart = lstRange[0],
	lngSeln = lstRange[1],
	iSelnEnd = iSelnStart + lngSeln;

var	lstLines = drafts.getTextInRange(iSelnStart, lngSeln).split(/\n/),
	strLine = lstLines.length ? lstLines[0] : '',
	lstMatches = strLine ? strLine.match(/^\t+/) : [],
	strIndent = (lstMatches && lstMatches.length ? lstMatches[0] : '') + '\t';	
drafts.setTextInRange(
	iSelnEnd, 0, strIndent + '\n'
);
drafts.setSelectedRange(iSelnEnd + strIndent.length, 0);

Advanced

Keyboard shortcut Command+K
Hide key Yes

Discussion

comments powered by Disqus