# Scripting Interface

JavaScript ECMAscript

The interface to scripting has been conceived as a console allowing the user to automate a number of tasks. It is, however, currently in a preliminary development state.

## Starting the Scripting Console Invocation

The scripting console window is easily called by pulling down the Scripting menu item from the &MineXp;program's Utilitiesmenu, as represented in .

Starting the scripting console window

## The Scripting Console Window

The scripting console window is described at .

The Scripting Console Window

The window is divided into three vertical panes. The left hand side pane collects all the program's feedback to the user, so they are informed of any new variable that is created in the JavaScript environment and made available to them. The middle pane has two regions. The upper region will display all the return values after any JavaScript command has been run. The lower region is the actual script input region. The right hand side region contains mainly the history of the commands issued during the previous and current scripting sessions.

## Running Scripts in the Scripting Console

The lower part of the middle panel of the scripting window is a text editor that has syntax colouring for JavaScript code. After having entered the script, hitting while maintaining pressed will run the script.

Upon running of the script, the output of the script is printed in the upper part of the same middle panel. Most often the output will be undefined (in grey colour), which is just fine. If the output is some actual value, it will be printed in green. If there was an error, the ouptut will be printed in red.

Note that each time a script is run, it is appended in the right hand side panel of the window, in the the History tab. The coloring of the items added to the History> tab follows the same logic as that described above.

## Loading Script Files in the Scripting Console

It is possible to craft ECMAscript-compliant scripts outside of the JavaScript console window, store them in files and open them for running in the JavaScript console window. To do so, select File→ Load a JavaScript file in the editor .

Once the script has been inserted into the script editor widget, the user can run it by hitting while maintaining pressed.