selectedText

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the selectedText [of { <field> | <button> }]
selectedText([{ <field> | <button> }])
Synonymshilitedtext
Summary

Returns the contents of the text selection.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
field

Any valid field reference.

button

Any valid button reference.

Example
the selectedText of field "Chapter Titles"
put the selectedText into thisSelection
Values
NameTypeDescription
return

The selectedText function returns a string.

RelatedKeyword: selection, field, lines, string, menu
Property: hilitedLine, listBehavior, menuHistory, selected
Control Structure: function
Object: field
Function: selectedLoc, clickText
Glossary: property, keyword, return, menu item
Description

Use the selectedText function to find out what text is selected.

If a field is specified, the selectedText function returns the selected text in that field. If the field's listBehavior property is set to true, the selectedText includes any selected lines in the field.

If a button is specified, the selectedText function returns the currently selected menu item associated with the button. If the button does not have a menu associated with it, the selectedText function returns empty.

If there is no insertion point or text selection and no field or button is specified, the selectedText function returns empty.

To get the location of the selected text, use the selectedChunk function.

To change the contents of the selection, use the selection keyword.

Tagsui