public readonly property hasSelection as Boolean:
Returns true when this view currently owns a non-empty text selection.
if view.hasSelection: print(view.selectedText())