.. |search-previous| image:: /medias/desktop/choregraphe/search_previous.png :class: img-inline .. _choregraphe-overview-script-editor-panel: Script Editor panel ==================== The Script Editor panel enables to **edit box scripts**. In the flow diagram, to open the script of: * a :ref:`box `: right-click on it and select **Edit box script**. * a :ref:`script box `: double-click on it. .. image:: /medias/desktop/choregraphe/chore_script_editor.png This editor integrates **syntax highlighting** to ease the edition. At the bottom of the panel you can see the **number of the selected line** on the left and a field to **search** a specific keyword in the script. See more about the available functionalities of this panel :ref:`here `. .. _choregraphe-detailed-interface-script-editor-panel: Script Editor panel +++++++++++++++++++ You have useful functions at the bottom of the panel: * **Search text field** to find a specific keyword in the current script: .. image:: /medias/desktop/choregraphe/chore_script_editor_find.png It is highlighted in red if the keyword is not found in the script: .. image:: /medias/desktop/choregraphe/chore_script_editor_find_red.png .. warning:: The searching function **does not** permit to **loop**. The search text field will highlight in red if string specified isn't found after the current location of the editing cursor. In this case, keep in mind you can use the button |search-previous| to **search before** the location of the cursor. * **Navigation buttons** to move to the previous or the next matching string: .. image:: /medias/desktop/choregraphe/chore_script_editor_find_prevnext.png * **Setting button** to specify **Match case** and/or **Match whole word** search options: .. image:: /medias/desktop/choregraphe/chore_script_editor_find_settings.png When the option **Match case** is enabled, only the strings with the same case match. So for example if you search "keyword", "KEYWORD" will not match. When the option **Match whole word** is enabled, the keyword is searched as a whole word. So for example if you search "keyword", you will not find it in the string "Iamakeyword" but only when it is written as a single whole word. .. note:: You can change the font of the Script Editor panel for a monospaced one in the :ref:`Choregraphe's preferences `. If you **right-click** in the panel, the following menu will be displayed: .. image:: /medias/desktop/choregraphe/script-editor-context-menu.png This **context menu** provides fast access to some classic functions for a script editor: * **Undo**: to revert last script modification. * **Redo**: to apply previously reverted modification. * **Cut**, **Copy**, **Paste** or **Delete**: to cut, copy, delete selected text block or paste text at the current location of editing cursor. * **Select All**: to select the complete script. * **Block comment or uncomment**: to toggle the current line or the selected text block commented or uncommented. It also enables you to make some other advanced actions: * **Insert Unicode control character**: to insert various characters. This menu is not always available depending on the OS. But anyway: .. warning:: **It is strongly advised to not use this menu** as it inserts characters that are not visible in the script editor and that may lead to errors during the execution of the behavior. * **Insert Function**: to insert a :ref:`built-in function ` only available from a box script.