Thanks ideasman_42 for showing that this was possible, but admittedly ugly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
text = bpy.context.edit_text | |
def has_selection(text): | |
return not (text.select_end_line == text.current_line and \ | |
text.current_character == text.select_end_character) | |
print(has_selection(text)) |