Skip to main content

selectedText

Type​

function

Summary​

Returns the contents of the text selection.

Syntax​

the selectedText [of { <field> | <button> }]
selectedText([{ <field> | <button> }])

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.

Parameters​

NameTypeDescription

field

Any valid field reference.

button

Any valid button reference.

Examples​

the selectedText of field "Chapter Titles"
put the selectedText into thisSelection

Value​

NameTypeDescription

return

The selectedText function returns a string.

function: selectedLoc, clickText

glossary: property, keyword, return, menu item

keyword: selection, field, lines, string, menu

object: field

property: hilitedLine, listBehavior, menuHistory, selected

control structure: function

Compatibility and Support​

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?