public hasSelection() as Boolean:
Returns true when a selection is active.
print(field.hasSelection())