# Execute Scripts From UI

## Launch Configurations

Executing script file from the UI typically involves a launch configuration. Each launch configuration will start a script in its own thread, separated from any other script. You may create/access such a configuration in multiple ways:

- Choose Run >Run As >EASE Script from the context menu of a file in the workspace.
- Choose Run >Run As >EASE Script from the context menu of an open editor containg script code.
- Select Run > Run Configurations... or Run > Debug Configurations... from the workbench menu bar.

The first 2 methods will automatically create a launch configuration and execute the script right away. In some cases, you will want to adjust the launch parameters or specify additional arguments. Therefore you have to choose the third option.

### How to create a launch configuration:

1. Select Run > Run Configurations... or Run > Debug Configurations... from the workbench menu bar.
2. This opens a dialog that lets you create, modify, and delete launch configurations of different types.
3. Select EASE Script in the left hand list of launch configuration types, and press the New button in the toolbar. This will create a new launch configuration for a script. The tabs on the right hand side allow you control specific aspects of the launch.

> - The Global tab defines the file to be launched. Either select a workbench file or a system resource here. After the file is selected you may change the script engine to be used.
>   Script arguments are passed to the script directly as String[] named argv. Enter multiple arguments by separating them with spaces.
>   The debug options allow to define which parts of the code get displayed and when to stop execution by default.
>   Show dynamic script content allows to step into dynamically generated script code such as module loading.
>   Suspend on startup stops execution in the first line of code.
>   Susped on script load additionally stops execution whenever a new source file gets executed (such as includes and dynamic code).

> For other tabs see Java Launch Configuration.

## Executing within the Script Shell

The script shell view allows to execute script file by using the include command. You may either type it in or directly drag and drop the file into the shell. As scripts are included, they are not spawned as a separate thread and run in the context of th script shell view. Therefore they have full access to the current variable stack. They also will block the shell until execution is terminated.

## Executing scripts from Script Explorer

Scripts fetched from script locations are visible within the Script Explorer view. There they can be executed by a double click and spawn as a separate thread, similar to an EASE Script launch configurations