Eggplant Functional Script Preferences
The General pane of the Script Preferences tab provides basic controls for working with scripts in your Eggplant Functional suites.
When a script is run: This preference determines how Eggplant Functional deals with unsaved script changes when you run a script. You have the following options:
- Don't save: Select this option to run scripts without saving changes.
- Save that script: Select this option to auto-save script changes before running scripts.
- Save all scripts: Select this option to auto-save all open scripts before running the current script.
- Ask to save: Select this option to be alerted to unsaved script changes when you run a script.
When a script is modified: This preference determines what Eggplant Functional does if another user saves changes to a script while you are using it. You have the following options:
- Ignore: Select this option to keep the script as it currently appears on your desktop without loading the newly saved version.
- Reload the script: Select this option to reload your script when Eggplant Functional detects that the saved version has changed.
- Ask to reload: Select this option to have Eggplant Functional ask you whether to keep the current version or load the saved version of your script.
Reload breakpoints from last save: Select this checkbox to automatically reset saved breakpoints when you open scripts.
Tab Key Behavior
Pressing the Tab Key: This preference determines what Eggplant Functional does when the tab key is pressed in the script editor. You have the following options:
Triggers Auto-Indenting: Default. This triggers auto-indenting of the script displayed and updates the colorization.
Inserts a Tab Character: Inserts a tab character but does not trigger auto-indenting or colorization of the script.
Inserts a Tab and Auto-Indents: Inserts a Tab character and triggers auto-indenting and colorization of the script.
Default Script Font: This field displays the default font of your text in the Script Editor. (New text and plain text loaded from other scripts are both displayed in this font.) Click Set to select a font on your system. This font choice is also used in the initial setting of the folder global property at the beginning of each script run.
Script Log Font: This setting determines the font used to display script results and output in the Log Area of the Run window. Click Set to select a font on your system.
Allow Text Drag and Drop: Drag-and-drop text is disabled in the Script Editor by default. Select this checkbox if you want to be able to move text by dragging it.
Action Scripts Templates File Section
When this field is blank, Eggplant Functional uses the built-in template file for generating Action Scripts. Click Customize to save a local copy of the template file that you can edit. Click Browse to locate a custom template file on your system.
The Completion pane of the Script preferences tab provides options for how the code auto-completion feature works when you're scripting in the Eggplant Functional Script Editor.
Punctuation Assistance: Defines the punctuation marks you want Eggplant Functional to auto-complete as you type in the Script Editor. Options include: Parentheses, Quotes, Commas, Curly Braces, and Square Brackets.
Auto-Complete Statements: Defines which statement types Eggplant Functional will auto-complete.
For example, with If Statements selected, when you begin typing an If statement, a pop-up window provides completion suggestions; you can select the variant you want to use from the list, and Eggplant Functional inserts the appropriate code, ready for you to customize. For an If Statement, the suggested completions look like this:
Suggested completions for "if".
When an option from the list is selected using Tab or Return, such as the "If (multiple statements)" option in the list above, the formatting of that choice is shown below the list of options. Bracketed items are editable values and display as tokens in the code when inserted.
To continue the above example, when the "If (multiple statements)" option is selected from the suggested completions shown above (using Tab or Return), code is inserted into the script that looks like this:
A basic auto-completion of an If statement using "If (multiple statements)"
Options for auto-completion include If Statements, Repeat Statements, and Handlers.
Suggested Completions: Provides options to control how script suggestions and insertions operate.
Show Suggestions While Typing, After Delay: This setting determines whether or not auto-completion suggestions will be displayed while typing, and the amount of time in seconds before they are displayed after you begin typing. This setting is on and set to 0.5 seconds by default. To disable auto-completion suggestions, de-select this checkbox.
Show With First Item Selected: If this checkbox is selected, suggested completions will display with the first suggestion selected automatically. This setting is off by default.
Suggest: Define which types of suggestions Eggplant Functional will offer to complete, by selecting or de-selecting the checkbox next to each item. Options include: Scripts, Keywords, Local Variables, and Images. All options are enabled by default.
Insert Selected Suggestion on: Select the key or keys you want to use to trigger inserting suggested completions.
All settings on the Theme tab of the Script preferences control the automatic color-coding of text in the Script Editor.
Syntax Color Preferences
These two check boxes control the behavior of syntax coloring. These are personal preference settings that are color related, but are not part of a theme.
The upper portion of the Theme tab, where the general theme-related settings are located.
Enable syntax coloring: Select this checkbox to turn on automatic script colorization.
Update colors continuously while typing: Select this checkbox to automatically update colors in the current script line as you type. If this feature is turned off, script colors are updated when you insert a comment, paste, save, or press Return.
The remaining controls in the Theme tab are related to specific themes. Themes are color schemes that determine how the different components of SenseTalk scripts are colorized in the scripts pane of the suite window, as well as the way indentation is used to display blocks of code within a SenseTalk script.
Theme: The Theme drop-down list allows you to select a theme. There are four color themes included with Eggplant Functional that determine the coloring of different elements and indentation of code blocks within a SenseTalk script. Built-in themes include Eggplant, Eggplant Classic (based on the original SenseTalk color scheme), Sunrise , and Sunset (a "dark mode" for the script editor). The Sunrise and Sunset theme colors are both based on the Solarized color palette developed by Ethan Shoonover.
The star drop-down list to the right allows you to duplicate, rename, and delete any non-default theme currently selected in the Theme drop-down. You cannot change or delete the built-in (protected) themes. However, any theme may be duplicated to create a new custom theme, which can then be changed in any way you choose.
The colors pane shows all of the different colors and font settings for the theme selected by the Theme drop-down list above the pane. Colors for built-in themes cannot be changed, and so appear grayed out. Themes can be duplicated or created from the star menu to the right of the Theme drop-down.
For each script element, select the checkbox associated with that element to auto-colorize it in the Script Editor.
To edit a script element’s color, click its color well and then select a new color in the standard Colors panel.
Each script element can be identified using bold or italic as well as a color. Click the "B" next to a script element to display the script element in bold text, and the "I" to display that element in italics.
Default: The color used to display default text. Default text includes miscellaneous words that aren't included in the coloring of other elements. If you disable the coloring for one or more elements of the script (an example would be de-selecting the checkbox next to "Functions" in a custom theme), then those elements will show up in the default color.
Background: The color used for the background in the script pane of the suite window.
Tokens: The color displayed in the script to identify editable values when using auto-complete for faster manual script writing.
This pane displays a preview of the way scripts appear in the Script Editor with your current colorization settings. As you make changes above, the example script updates automatically to reflect the new settings.
The Indentation pane of the Script preferences tab includes settings to control the automatic indentation of text in the Script Editor.
Indent scripts automatically: Select this checkbox to apply indentation when you insert a comment, paste text, or press Return.
Indent control structures by / Indent continuation lines by: These preferences determine the size of your automatic indentations. Select Tab(s) or Space(s), then enter the number of tabs or spaces to indent. Continuation line refers to a long statement displayed across multiple lines. To force a line break in a statement, insert a backslash (/).
The Tab Key. Choose an item in this drop-down list to determine the function of Tab in the Script Editor. The Tab key can trigger indentation, insert a tab space, or both.
This pane shows a script with the current indentation settings. As you make changes in the Script Indentation section, the example script updates automatically to reflect the new settings.
- Win: ~\Application Data\Eggplant\ScriptThemes.json
- Mac & Linux: ~/Library/Eggplant/ScriptThemes.json
The Tab Key Behavior settings in the General tab are different and are stored in a .plist file in the same location.