Skip to main content
Version: 8.1

Script Console

Inductive University

Scripting Console

Watch the video

The Script Console is a live Python terminal that is only accessible in the Designer. It is a great way to very quickly test a script as it does not rest on a scripting event or specific component. The Script Console can be opened via the Tools > Script Console menu. It consists of two parts: a Multiline Buffer, and an Interactive Interpreter. Code can be typed into both sides.

Due to how scope works, the Script Console can not interact with components on a window, but it can call Project and Shared scripts. If a Project or Shared script was recently added, then the console will need to be reset before it can be called. This can be accomplished by clicking on the Reset icon in the upper right.

note

Gateway-scoped information will not appear in either the Script Console or Output Console. Instead, the output will be sent to the wrapper.log file. Alternatively, system.util.getLogger will send messages to the Gateway Console, and is a preferred method of troubleshooting Gateway scoped scripts.

Features

There are several icons and user interface elements located on the Script Console window. The image below highlights a syntax error.

A reference of the icons and descriptions are found in the table below:

IconNameDescription
ClearClears the text from the Interactive Interpreter.
ResetClears and resets the text, and deletes all user defined objects (variables and functions) from the Interactive Interpreter.
Expand/CollapseExpands / Collapses Multiline Buffer and Interactive Interpreter.
Syntax Error HighlightShows up next to a line in the Multiline Buffer identifying an error. Hover over the Error Symbol to see information on the exception.

Multiline Buffer

The Multiline Buffer, located on the left side of the Script Console, allows for multiple lines of code to be entered and then executed by clicking on the Execute button. All print statements will output to the Interactive Interpreter. It also supports code folding for function definitions and comments.

When executing a script in the console, the Execute button will change to an Interrupt button. Developers can press the Interrupt button to interrupt / stop a script from executing when testing code with a lot of data, or when the script inadvertently gets stuck in an infinite loop.

Font Size Adjustment

Font size in the Multiline Buffer can be adjusted by holding Ctrl and scrolling the mouse wheel.

Right-Click Menu

Right-clicking on the Multiline Buffer opens a menu. The menu options are described in the table below.

Main Menu Options

NameDescription
UndoUndoes the last action.
RedoGets rid of the last undo action.
CutCuts the selected text.
CopyCopies the selected text.
PastePastes the selected text.
DeleteDeletes the selected text.
Select AllSelects all text in the window.

Folding

NameDescription
Toggle Current FoldExpand or collapse the fold where the text cursor is located.
Collapse All CommentsCollapse all instances of multi-line comments. Only contiguous comments are collapsible.
Collapse All FoldsCollapse all expanded folds.
Expand All FoldsExpand all collapsed folds.

Autocompletion

NameDescription
Automatic ActivationDetermines access to the Autocompletion window. If set, the window will automatically appear after a second of inactivity occurs when "system." has been typed. If not set, the window can still be accessed manually by pushing Ctrl+Space.
Description WindowShows or hides the Description pane in the Autocompletion window.
Parameter AssistanceEnables parameter assistance for known function arguments.

Appearance

NameDescription
WhitespacePaints an arrow character in whitespace sections (tabs and spaces) for each line.
Tab LinesPaints lines at the indentation level of each tab stop.

Find/Replace

Pressing Ctrl+R while the text cursor is in the Multiline Buffer opens a Find and Replace window. This will search for instances of text throughout the Multiline Buffer, and allows the user to replace all or some instances with new text.

Keyboard Shortcuts

The following shortcuts apply only to the Multiline Buffer.

Key(s)Description
Ctrl + </> (on the number pad)Collapse all folds.
Ctrl + <\*> (on the number pad)Expand all folds.
Ctrl + <-> (on the number pad)Collapse the fold on the same line as the text cursor.
Ctrl + <+> (on the number pad)Expand the fold on the same line as the text cursor.
Ctrl + <Space>Open Autocompletion window. By default, the window will automatically open once "system." has been typed.
Ctrl + <R>Open Find/Replace window.
Ctrl + <Mouse Wheel Scroll>Increase and decrease the font size.
Ctrl + <Enter>Executes the script in the script editor.

Interactive Interpreter

The Interactive Interpreter is located on the right side of the Script Console, and allows you to run a single line of code at a time. Code is executed from the Interactive Interpreter by pressing the Enter key. Print statements from both sides of the Script Console will appear in the Interactive Interpreter.

The Autocompletion window, available in the Interactive Interpreter, has access to the current working environment so items such as Project and Shared scripts will automatically appear. They can also be typed in manually.

New in 8.1.33
When first opened or refreshed, the Interactive Interpreter default header text has displayed the Jython version. Now, it also includes a reminder that the code executes in the local Designer scope (no access to Gateway methods), and instructions for how to trigger the autocomplete hint popup using the the Ctrl + Space keys.

Keyboard Shortcuts

The following shortcuts apply only to the Interactive Interpreter

Key(s)Description
Ctrl + <L> Clear the Interactive Interpreter. Functionally the same as clicking the Clear button.
Ctrl + <R> Reset the Interactive Interpreter. Functionally the same as clicking the Reset button.
Up arrowCycle backward through command history.
Down arrow Cycle forward through command history.
Ctrl + <C>Keyboard interrupt.
Ctrl + <Space>Open Autocompletion window. By default, the window will automatically open once an "object." has been typed such as "system" or "project," and a Project script has already been defined.
Ctrl + <A>Move the text cursor to the start of the line. Similar to pressing the Home key.