MacRabbit

MRLineStorage

JavaScriptAPI : TextActionContext : MRLineStorage

MRLineStorage is a special object accessible from the TextActionContext that allows you to work with the lines in the context document.

Read-only properties

  • numberOfLines: the total number of lines in this context

Methods

lineStartIndexLessThanIndex(characterIndex)

Returns the character index for the beginning of the line that contains the given characterIndex.

lineStartIndexGreaterThanIndex(characterIndex)

Returns the character index for the beginning of the line that follows the line containing the given characterIndex.

lineNumberForIndex(characterIndex)

Returns the line number for the line that contains the given characterIndex.

lineRangeForIndex(characterIndex)

Returns the Range for the line that contains the given characterIndex.

lineRangeForLineNumber(lineNumber)

Returns the Range for line number lineNumber.

lineRangeForRange(range)

Returns the Range for the line(s) that completely encompass the Range range.