{"identifier":47006,"topic":"Commands","name":"select","text":"<code><pre>select empty\nselect <i>button<\/i>\nselect <i>field<\/i>\nselect text of <i>container<\/i>\nselect before text of <i>container<\/i>\nselect after text of <i>container<\/i>\nselect <i>chunk<\/i> of <i>container<\/i>\nselect before <i>chunk<\/i> of <i>container<\/i>\nselect after <i>chunk<\/i> of <i>container<\/i><\/pre><\/code> <br><br>\n\n <b>Note:<\/b><code> <i>container<\/i> <\/code>cannot be a variable. <br>\n<br>\nThe<code> select <\/code>command selects buttons, fields, or text.  <br><br>\n\n <code>Select<\/code> <i><code>button<\/i><\/code>  selects a button as if you had chosen the Button tool and clicked it.<code> Select<\/code> <i><code>field<\/i> <\/code>selects a field as if you had chosen the Field tool and clicked it. <br><br>\n\n Note: You can\u2019t use<code> select <\/code>to select hidden buttons or fields, and the user level must be set to Authoring or Scripting for<code> select <\/code>to work. <br>\n","related":{"24266":null,"12857":"autoSelect","100041":"multipleLines","63264":"selectedChunk","63565":"selectedField","63809":"selectedLine","2765":"selectedLoc","64031":"selectedText"},"examples":"-- Select a button or a field:\nselect background button id 12\nselect card field 1\nselect me\n\nselect empty\n\n-- Set the insertion point in a field:\nselect before word 2 of field \"syntax\"\nselect after line 1 of first field\nselect after text of cd fld id 2378 \n\n-- Select a range of text in a field or msg box:\nselect char 1 of field \"syntax\"\nselect item 2 of field \"names\"\nselect word 4 to 9 of message box\nselect text of me -- from a script\nselect text of target -- from a script\nselect line 1 of me -- from a script\nselect line 3 to 6 of field \"Choices\" -- in a list field\n\n-- Select a line in a pop-up menu:\nselect line 3 of button \"Maps\"","demo":"on selectDemo\n   -- select an object and move it:\n   <b>select<\/b> bkgnd button \"Run the Script\"\n   set dragSpeed to 60\n   drag from 386,255 to 386,75\n   wait 1 second\n   domenu \"undo\"\n   <br><br>\n\n   -- select a range of characters:\n   set cursor to watch\n   <b>select<\/b> char 181 to 210 of bkgnd field \"Demo Script\"\n   wait 2 seconds\n   <b>select<\/b> empty\n end selectDemo\n ","debug":{"9":["select empty\rselect "],"10":["The select command s"]}}