-->
Indent

Script key: Indent

Posted by @complexpoint

Install

Details

Label -->
Voice Over Indent
Script
var	rngSeln=getSelectedRange(),
	iSelnFrom=rngSeln[0], iSelnTo=rngSeln[1],
	rngLines=getSelectedLineRange(),
	iFrom=rngLines[0], iTo=rngLines[1],	
	strLines='\t'+
		getTextInRange(
			iFrom, iTo
		).replace(/\n/g,'\n\t').slice(0,-1),
	lngLines=strLines.trim().split('\n').length;

setTextInRange(iFrom, iTo, strLines);
setSelectedRange(
	iSelnFrom + Number(iSelnFrom > iFrom),
	iSelnTo + lngLines - Number(iSelnTo < iTo)
);

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus