selectedChunk

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the selectedChunk
selectedChunk
Summary

Returns a chunk expression describing the location of the text selection or insertion point.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
the selectedChunk
put the selectedChunk into storedChunk
Values
NameTypeDescription
return

The selectedChunk function returns a chunk expression of the form char startChar to endChar of field fieldNumber.

RelatedKeyword: selection, character
Property: selected
Command: select
Function: selectedField, selectedLine, selectedLoc, foundChunk, clickChunk, mouseChunk
Control Structure: function
Glossary: chunk expression, insertion point, return
Description

Use the selectedChunk function to determine which text is selected.

The return value reports the selected text: the startChar is the first character of the selection, and the endChar is the last character.

If no text is selected but the text insertion point is in a field, the startChar is the character after the insertion point, and the endChar is the character before the insertion point. In this case, the endChar is one less than the startChar.

If there is no insertion point or text selection, the selectedChunk function returns empty.

To get actual text that is selected, use the selectedText function.

Tagsui