The Selection.getRangeAt() method returns a range object representing one of the ranges currently selected.
Selection.getRangeAt()
external Range getRangeAt(int index);