Editor Options
The Script Editor is used to edit scripts used in Run Script tasks and the XSLT Editor is used to edit scripts used in Open XSLT action tasks (see Using Scripts and The Script Editor and XSLT Editor).
There are a number of options for the editors, which you can set via the menu: Tools > Options, in the editor. Most of the options listed below are valid for both editors. Those options which are only valid for a specific editor are identified as such.
- Editor
- Auto indent mode: Select to automatically position the insertion pointer under the first non-blank character of the preceding line when you press ENTER.
- Insert mode: Select to use Insert mode and clear to use Overwrite mode. In Insert mode, when you enter text, existing text shifts to accommodate it. In Overwrite mode, text you enter overwrites existing text. You can also press INSERT to toggle between the two modes.
- Use tab character: Select to use the tab character instead of spaces to represent tabs in the program file. Clear to use spaces to represent tabs. You must clear the Smart tab option to use this option.
- Smart tab: Select to use smart tabs. A smart tab advances with reference to the preceding line. It advances to align with the first non-blank character it encounters on the preceding line, from its current position forward. You must clear the Use tab character option to use Smart tabs.
- Optimal fill: Select to optimize the indent of every auto-indented line by minimizing the number of space and/or tab characters it uses. You must select both Auto indent mode and use tab character to use this option.
- Backspace unindents: Select to move the insertion pointer to the previous indentation level when you press BACKSPACE. This is useful when you enter a block of code such as a for loop; you enter the for statement, advance one indentation level to enter the body of the for loop, then press BACKSPACE to enter the end for statement. You must select Auto indent mode to use this option.
- Cursor through tabs: Select to move one by one through the spaces of tabs using the left or right arrow keys. Clear to have the arrow keys treat the tab as a single character. You must select Use tab character to use this option.
- Group undo: Select to set the undo feature of the Editor to undo the last group of editing commands entered. An editing command is defined as a mouse click, a press on ENTER, or a press on any other key. A group of editing commands is a sequence of a single type of editing command. Clear to set the undo feature to undo only the last command entered.
- Cursor beyond EOF: Select to make it possible to position the pointer beyond the end of the program file. Clear to prevent this. If you clear Insert mode and select Cursor beyond EOF, you can only overwrite the existing lines of the program; you cannot add lines to it.
- Cursor beyond EOL: Select to make it possible to position the pointer beyond the end of the line. Clear to prevent this.
- Keep trailing blanks: Select to preserve any blank spaces occurring at the end of a line. Clear to remove those blank spaces.
- Persistent blocks: Select to have any text you enter immediately after selecting a block of code appended to that block of code as part of the selection. When you select this option, you can also use the arrow keys to move within the code without affecting the selected code. You must select the Enable selection option to use the Persistent blocks option.
- Overwrite blocks: Select to have any text you enter immediately after selecting a block of code replace that block of code. You must clear Persistent blocks and select Enable selection for this option to have an effect.
- Enable selection: Select to permit the creation of selections in the Code area. If selected, you can create a selection by clicking and dragging the pointer over a portion of code, or by double-clicking to highlight the word or line under the pointer (the Double click line option determines whether a word or line highlights). You can cut, copy, paste, and print selections. If you also select Enable dragging, you can drag selections to reposition them in the code.
- Enable dragging: Select to permit dragging and dropping a selection to reposition it in the program. This option works only if you also select Enable selection.
- Enable search highlight: Select to highlight the search term match found in the code when you perform a search. Clear to prevent the highlighting. In both cases, the pointer appears after the last character of the search term match.
- Double click line: Select to highlight the complete line of code when you double-click that line. Clear to highlight only the word under the pointer.
- Find text at cursor: Use to set the behavior of the Find dialog box. Select to automatically copy the word under the pointer into the Text to find box when you open the Find dialog box. Clear to prevent the copy. If no previous search terms appear in the Text to find drop-down list, the Editor performs the copy regardless of whether this option is selected or cleared.
- Block indent: Enter the number of spaces to jump for each block indent. The default is 2 and the maximum is 16. The Block indent typically should agree with the tab stops in the Tab stops option. Perform a block indent by selecting a region of code and pressing CTRL+SHIFT+I (to indent the code to the right) or CTRL+SHIFT+U (to move the code to the left).
- Tab stops: Use to set the number of spaces to advance when you enter a tab character or to set a series of tab stops. Enter a single integer to set the number of spaces to advance with each tab. Enter a sequence of two or more integers, each separated by a space, to specify tab stops. The sequence must be in ascending order. Tab stops are measured in number of space characters. For example, a value of 20 places the tab stop at the 20th space character. You can also use the drop-down list to select a previously entered value.
- Display
- Display Options Group
- Editor font: Use to select the font the Editor uses to display the program code. Select the Use monospace fonts only option to restrict the fonts available to fixed width fonts. A preview of the selected font, at the selected Size, appears in the Sample box.
- Size: Use to select the font size the Editor uses to display the program code. A preview of the selected font, at the selected size, appears in the Sample box.
- Use monospace fonts only: Select to display only fixed width fonts in the Editor font drop-down list. Every character in a fixed width font occupies the same amount of space.
- Sample: Displays a preview of the font selected in the Editor font option, at the size selected in the Size option.
- Margin and Gutter Group
- Right margin: Select to display a vertical gray bar as a right margin indicator. Use the Right margin position drop-down list to set the position of this indicator. This indicator is an on-screen visual reference only. It does not print, and does not enforce word wrap on lines that exceed the number of characters set for it. It can be useful to indicate the right margin of the printed page, making it easy to determine whether a line of code extends beyond the printable area of the page.
- Right margin position: Enter the position of the right margin indicator, in number of characters, relative to the left margin. For example, if you enter 80, the distance from the left margin to the right margin indicator is 80 characters. Use the drop-down list to select a previously-entered margin position.
- Gutter: Select to have the Editor display a gutter between the Commands and Code areas. Use the Gutter width option to set the width of the gutter. Select the Line numbers on gutter option to display line numbers in this area.
- Gutter width: Enter the width, in pixels, of the gutter. Use the drop-down list to select a previously-entered gutter width.
- Line numbers on page: Select to display code line numbers at the left edge of the Code area. If you clear both this and the Line numbers on gutter option, no line numbers appear alongside the lines of code.
- Line numbers on gutter: Select to display code line numbers in the gutter between the Commands and Code areas. Selecting this option has effect only if you selected the Gutter option. If you clear both this and the Line numbers on gutter option, no line numbers appear alongside the lines of code.
- Display Options Group
- Color
- Mapping: Select a mapping for the content of the script in the script editor—the mapping is used as well when the script appears in the text box of the Run Script Actions Properties dialog. Each mapping (Default, Classic, Ocean, Twilight) includes pre-set color values and attributes for each script element as listed in the Elements list box. After selecting a mapping, you can edit individual elements to change their pre-sets by selecting them in the Element list box and editing their values.
- Element list box: Select a script element in the Element list box, then edit the background and foreground color with which it is displayed, and/or its formatting attributes. Each element recognized for each scripting language, for example, a URL in a JavaScript script, is displayed with the properties you set.
- Foreground: Select the color that the element highlighted in the Element list box is displayed with in the Script Editor.
- Background: Select the background color that the element highlighted in the Element list box is displayed with in the Script Editor. The color is used to highlight the element as if it was selected with the cursor.
- Attributes Group
- Bold: Select to bold the element highlighted in the Element list box when it is displayed in the Script Editor.
- Italic: Select to italicize the element highlighted in the Element list box when it is displayed in the Script Editor.
- Underline: Select to underline the element highlighted in the Element list box when it is displayed in the Script Editor.