-->
Indent

Script key: Indent

Install

Details

Label -->
Voice Over Indent
Script
drafts = this;

var lstSelnRange = drafts.getSelectedRange(),
	lstLineRange = drafts.getSelectedLineRange(),

	iLinesStart = lstLineRange[0],
	iLinesChars = lstLineRange[1] ? lstLineRange[1] - 1 : 0,

	lstLines = drafts.getTextInRange(
		iLinesStart, iLinesChars
	).split(/\n/).map(
		function (strLine) {
			return '\t' + strLine;
		}
	);

drafts.setTextInRange(iLinesStart, iLinesChars, lstLines.join('\n'));
drafts.setSelectedRange(
	lstSelnRange[0] + 1,
	lstSelnRange[1] + lstLines.length - 1
);

Advanced

Keyboard shortcut Command+]
Hide key Yes

Discussion

comments powered by Disqus