The Field_GetSelection() function retrieves the text currently selected in a text field.
Field_GetSelection(text_field, {start_position, length})
• text_field – The text field from which you are retrieving the selection.
• start_position – A returned integer containing the starting position of the selection.
• length – A returned integer containing the length of the selection. If no text is selected, 0 is returned.
A string containing the selected text. Up to 255 characters can be returned.
If more than 255 characters are selected, only the first 255 characters are returned. You can use the substring() function to retrieve the additional characters.