get-position in text%

Returns the current selection range in positions. See also get-start-position and get-end-position.