メインコンテンツまでスキップ
バージョン:23.4

Eggplant Functional Script Preferences

Eggplant Functional Script Preferences contain the controls for features that can make it easier for you to read and write scripts. Script Preferences can be found by going to Eggplant > Preferences, then selecting the Script tab.

General

The General pane of the Script Preferences tab provides basic controls for working with scripts in your Eggplant Functional suites.

The Script General preferences tab in Eggplant Functional The Script preferences General pane, shown with default settings.

Script Saving

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 running script calls another script, the called script is read from the currently saved copy. If you have unsaved changes in the called script, they are not executed.

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.

Text

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.

Completion

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.

The Script Completion preferences tab in Eggplant Functional The Script preferences Completion pane, shown with default settings.

Punctuation Assistance: Defines the punctuation marks you want Eggplant Functional to auto-complete as you type in the Script Editor. Options include:

  • Curly Braces: Curly braces are used primarily to indicate property lists. Select this option to have Eggplant Functional auto-complete curly brace pairs while typing.

  • Square Brackets: Square brackets are used to indicate lists. Select this option to have Eggplant Functional auto-complete square bracket pairs while typing.

  • Quotes: Quotes are used to indicate string literals. Select this option to have Eggplant Functional auto-complete quote pairs while typing.

  • Commas: Select this option to have Eggplant Functional auto-correct comma usage. For instance, this can be used to ensure the correct number of commas when completing snippets that contain lists.

  • Parentheses: Parentheses are used to group expressions and to surround parameters being passed in function calls. In earlier versions of Eggplant Functional, parentheses were used as the standard formatting for lists. While they are no longer the recommended syntax for lists, they can still be used on single-line lists. Select this option to have Eggplant Functional auto-complete pairs of parentheses.

    ノート

    This option can only be enabled when Standardize Brackets While Typing in the section below is disabled.

Standardize Brackets: These preferences define when Eggplant Functional will automatically standardize brackets after typing, including converting any lists or property lists using old formatting to align with current recommendations.

Any of the three types of brackets - curly , square [], or parentheses () - can be used to define lists or property lists, but it is recommended to use square brackets for lists and curly braces for property lists to ensure clarity and readability of scripts. The two preference options in this section, as well as the associated menu item (Edit > Standardize Brackets in Script) analyze the contents between the brackets to determine if it is a list or property list and whether the brackets need converting. This allows you to type any kind of bracket, and have it standardized after typing. For more information, see Lists and Property Lists.

  • Standardize Brackets While Typing: Enables the standardization of brackets. Any kind of brackets detected around lists will be converted to square brackets [], while those used around property lists will be converted to curly braces .

    ノート

    This option can only be enabled when Punctuation Assistance for Parentheses is disabled.

  • Standardize All Brackets on Script Load or Reformat: This setting standardizes all brackets when the script is reloaded or reformatted (by typing Tab, assuming your Tab Key Behavior settings are set to default). Standardization ensures that lists use square brackets, and property lists curly braces.

ノート

There is also an option in the Eggplant Functional menu to standardize all brackets in a script. Go to Edit > Standardize Brackets in Script to standardize brackets used in the current script. This only standardizes the brackets once, and takes effect immediately.

Auto-Complete Statements: These settings determine which statement types Eggplant Functional will auto-complete by adding the closing half of the statement. Options for auto-completion include If Statements, Repeat Statements, and Handlers.

For example, if you type "if imagefound("OKButton")" and then hit return, Eggplant Functional will automatically create a conditional block for you by adding the "end if" closing text and moving your cursor to the new line of the conditional block. It will look like this:

auto-completion of an if conditional statement in SenseTalk

Suggested Completions: These provide options to control how script suggestions operate. Suggested completions functionality causes a drop-down menu to appear as you are typing, assisting in the completion of various script elements, which can include scripts, keywords, local variables, and images.

  • 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.

How Suggested Completions Work

When you begin typing, a pop-up window provides completion suggestions. For instance, if you type "if", you can select the variant of the if...then...else... conditional statement 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 when Auto-Completing an If Statement in Eggplant Functional 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:

An auto-completed If Statement in Eggplant Functional A basic auto-completion of an If statement using "If (multiple statements)"

Theme

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.

Script preferences Theme tab in Eggplant Functional 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.

Themes

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.

ノート

If you modified the SenseTalks colors prior to updating to Eggplant Functional 20.1, then the first time you launch the new version of Eggplant Functional, it will create a custom theme and set that new theme to be your default. This custom theme will be named “[Username]_custom”.

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 names of built-in themes are shown in bold. Names of custom themes are shown in plain text.

Colors Pane

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.

Script Preferences Theme tab Colors in Eggplant Functional The Script preferences Theme pane, shown with the Colors sub-pane selected.

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.

ノート

If the system font does not support italics, then no script elements will appear in italics even if it is indicated on this panel that they should.

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.

Example Script

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.

Indentation Pane

Script Preferences Theme tab Indentation in Eggplant Functional The Script preferences Indentation pane, shown with default settings.

The Indentation pane of the Script preferences tab includes settings to control the automatic indentation of text in the Script Editor.

Script Indentation

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 (/).

Example Script

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.

ノート

Color themes include both the color settings as well as the indentation settings. These are stored in the user preference files, and can be located at:

  • 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.