# Headless Script Execution

In headless mode a single script can be launched using a specific application. As no UI is available in that mode, scripts trying to access UI elements will fail.

## Application org.eclipse.ease.listEngines

Provides a list of available script engines. No further command line arguments are supported.

### Example

`eclipsec.exe -application org.eclipse.ease.listEngines`

## Application org.eclipse.ease.runScript

Allows to execute a single script either from workspace or the file system.

### Command line arguments

-script <script location>
  script location to execute from. Either an absolute path or a URI. Accepts workspace:// style URIs if a workspace is provided. Needs to be the last parameter provided!
-workspace <workspace location>
  OPTIONAL: workspace location to execute from. If not provided, no workspace will be loaded.
-refreshWorkspace
  OPTIONAL: when a workspace is provided perform a refresh to sync with the local file system.
-engine <engine ID>
  OPTIONAL: Script engine ID to be used for script execution. If not provided, the default engine for the given script source will be used.
-help
  OPTIONAL: Prints parameter help to standard output. If set, all other parameters are ignored and no script is executed.

Any argument after the script parameter is passed to the script within an argv[] variable of type String[]. argv[0] always contains the name of the script file.

### Example

`eclipsec.exe -application org.eclipse.ease.runScript -workspace "C:\my workspace location" -refreshWorkspace -script "workspace://Example Project/src/script1.js" param1 param2`