<doc>
  <legacy_id>2334</legacy_id>
  <name>selectedText</name>
  <type>function</type>
  <syntax>
    <example>the selectedText [of <i>field </i>| <i>button</i>]</example>
    <example>selectedText([<i>field </i>| <i>button</i>])</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
    <synonym>hilitedText</synonym>
  </synonyms>
  <classification>
    <category>User Interaction</category>
  </classification>
  <references>
    <function tag="selectedLoc">selectedLoc Function</function>
    <function tag="clickText">clickText Function</function>
    <property tag="menuHistory">menuHistory Property</property>
    <property tag="hilitedLine">hilitedLine Property</property>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary><glossary tag="return">Returns</glossary> the contents of the text <keyword tag="selection">selection</keyword>.</summary>
  <examples>
    <example>the selectedText of field "Chapter Titles"</example>
    <example>put the selectedText into thisSelection</example>
  </examples>
  <description>
    <p>Use the <b>selectedText</b> <control_st tag="function">function</control_st> to find out what text is <property tag="selected">selected</property>.</p><p/><p><b>Parameters:</b></p><p>The <i>field</i> is any valid <href tag="reference/object_reference.rev">field reference</href>.</p><p/><p>The <i>button</i> is any valid <href tag="reference/object_reference.rev">button reference</href>.</p><p/><p><b>Value:</b></p><p>The <b>selectedText</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a <keyword tag="string">string</keyword>.</p><p/><p><b>Comments:</b></p><p>If a <i>field</i> is specified, the <b>selectedText</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the <property tag="selected">selected</property> text in that <keyword tag="field">field</keyword>. If the <glossary tag="field">field's</glossary> <property tag="listBehavior">listBehavior</property> <glossary tag="property">property</glossary> is set to true, the <b>selectedText</b> includes any <property tag="selected">selected</property> <keyword tag="lines">lines</keyword> in the <keyword tag="field">field</keyword>.</p><p/><p>If a <i>button</i> is specified, the <b>selectedText</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the currently <property tag="selected">selected</property> <glossary tag="menu item">menu item</glossary> associated with the <i>button</i>. If the <i>button</i> does not have a <keyword tag="menu">menu</keyword> associated with it, the <b>selectedText</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> empty.</p><p/><p>If there is no insertion point or text selection and no <i>field</i> or <i>button</i> is specified, the <b>selectedText</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> empty.</p><p/><p>To get the location of the selected text, use the <b>selectedChunk</b> <control_st tag="function">function</control_st>.</p><p/><p>To change the contents of the selection, use the <b>selection</b> <glossary tag="keyword">keyword</glossary>.</p>
  </description>
</doc>