> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/skrypty-scriptservice/edytor-skryptow.md).

# Script editor

## Script view <a href="#edytorskryptow-widokskryptuedycja" id="edytorskryptow-widokskryptuedycja"></a>

In the main script view, the selected script version is visible. In the side panel there are buttons that allow opening the script parameters, unit tests, and logs panels.

The script run button is located in the tab **Parameters**.

<figure><img src="/files/6392a0994f773b8aa2b389012f62d9e2797eb045" alt=""><figcaption><p><em><strong>Figure 1.</strong> Script view with the "Parameters" panel open</em></p></figcaption></figure>

## Script editing <a href="#edytorskryptow-edycjaskryptu" id="edytorskryptow-edycjaskryptu"></a>

Working on the script is possible thanks to the Monaco editor (the editor supports JavaScript).

Initially it operates in **read-only**. To start working, click the button **Edit script** located at the end of the navigation bar.

<figure><img src="/files/38b65a9dcd4aacc38a78456ee8750f0eaed4f464" alt=""><figcaption><p><em><strong>Figure 2.</strong> Script tab</em></p></figcaption></figure>

The guide "how to write a service script" is in [Scripts (scriptService)](/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/skrypty-scriptservice.md) and [ScriptCode best practices](/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/dobre-praktyki-scriptcode.md).

## Variables in ScriptCode within block scope <a href="#edytorskryptow-zmiennewscriptcodewzakresiebloku" id="edytorskryptow-zmiennewscriptcodewzakresiebloku"></a>

The Eximee platform requires that variables in ScriptCode be declared within block scope.

Failure to declare a variable will cause a script error.

## Parameters <a href="#edytorskryptow-parametryparametry" id="edytorskryptow-parametryparametry"></a>

Parameter modification also takes place in Monaco (the editor supports JSON notation).

On the first visit to a non-empty script, the parameters will be automatically inferred (if possible) from the script content itself.

Below the editor there is a button that allows you to run the script with the parameters provided in the section **Test data.**

<figure><img src="/files/5c2589320e01c63135ea45dce44829c4a6ba73c8" alt=""><figcaption><p><em><strong>Figure 3.</strong> Parameters tab</em></p></figcaption></figure>

Parameters filled in the section **Test data** are not part of the script itself and will not be saved in that version!

## Editing inputs/outputs <a href="#edytorskryptow-edycjawejsc-wyjscio" id="edytorskryptow-edycjawejsc-wyjscio"></a>

Here we can add or remove service script inputs/outputs.

Adding or removing an input will also update the runtime parameters, so after removing a parameter we will lose its possible mapping at the binding location.

<figure><img src="/files/11021088138dbbf32dd8a293879f46a58518f1fa" alt=""><figcaption><p><em><strong>Figure 4.</strong> Inputs/outputs editing fields</em></p></figcaption></figure>

## Script result <a href="#edytorskryptow-wynikskryptuwynik" id="edytorskryptow-wynikskryptuwynik"></a>

An additional window appears at the bottom of the screen. There you can find all information about the executed script:

1. Script execution time given in ms.
2. Script execution logs in the form:

   | `[OPERATION_TIME] [OPERATION_TYPE]: Operation text` |
   | --------------------------------------------------- |

   For example:

   | `[14:31:22,976] [GET_DATA]: Called getData("GesCustomComponent1","data") and resulted in data from cc` |
   | ------------------------------------------------------------------------------------------------------ |
3. Result of calling the script (in the logs panel), i.e. all values defined as outputs during service script creation in the form KEY : VALUE.<br>

   <figure><img src="/files/2383681fa8db420e70c0dfb885bb5bb6c553e03f" alt=""><figcaption><p><em><strong>Figure 5.</strong> Script result tab</em></p></figcaption></figure>

## Monaco editor (keyboard shortcuts)

The editor used in the project is a full-fledged code editor, which is why it offers many keyboard shortcuts that speed up everyday work.

### Navigation and search

| Shortcut             | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| **F1**               | Display the list of all available editor commands and shortcuts. |
| **Ctrl + F**         | Search for text in the current file.                             |
| **Ctrl + H**         | Search and replace text.                                         |
| **Ctrl + Shift + O** | Jump to a variable or function.                                  |
| **Ctrl + G**         | Jump to the specified line.                                      |

### Code editing

| Shortcut             | Description                                                                   |
| -------------------- | ----------------------------------------------------------------------------- |
| **Ctrl + Z**         | Undo the last change.                                                         |
| **Ctrl + Y**         | Redo the undone change.                                                       |
| **Ctrl + C**         | Copy selected text.                                                           |
| **Ctrl + V**         | Paste copied text.                                                            |
| **Ctrl + X**         | Cut selected text or the current line.                                        |
| **Ctrl + Shift + I** | Format code. It is worth using this option after major changes in the script. |
| **Ctrl + Shift + K** | Delete the current line.                                                      |
| **Alt + ↑**          | Move the current line one line up.                                            |
| **Alt + ↓**          | Move the current line one line down.                                          |

### Multiple cursors and simultaneous editing

The Monaco editor allows simultaneous editing of multiple places in the code. This feature is especially useful when modifying variable names, parameters, or repeated fragments of the script.

| Shortcut                       | Description                                                                                        |
| ------------------------------ | -------------------------------------------------------------------------------------------------- |
| **Alt + mouse click**          | Add an additional cursor at the selected location.                                                 |
| **Ctrl + D**                   | Select the next occurrence of the currently selected text and add a cursor.                        |
| **Ctrl + Shift + L**           | Select all occurrences of the currently selected text and add cursors at all occurrence locations. |
| **Ctrl + F2**                  | Add a cursor at all occurrences of the current word or selection.                                  |
| **Ctrl + Shift + Alt + ↑ / ↓** | Add a cursor on the line above or below the current cursor position.                               |

### Additional functions

| Shortcut     | Description                               |
| ------------ | ----------------------------------------- |
| **Ctrl + P** | Export the script document to a PDF file. |

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FnQx2uljBANGDZtDDAMdc%2FmonacoShortcut.mp4?alt=media&token=eb66880d-780f-4615-9428-3d6922c09e23>" %}
***Video 1.** Example use of the Ctrl + Shift + L keyboard shortcut to simultaneously rename all occurrences of a variable*
{% endembed %}

## Tests <a href="#edytorskryptow-testy" id="edytorskryptow-testy"></a>

The editor allows defining [test scenarios](/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/testy-jednostkowe-skryptow.md).

### Errors during test execution

If the script contains errors, during test execution such an error will be logged to the console below the editor. The message will include the cause and the location in the code where the error occurred.

<figure><img src="/files/f4e55cd08aeb64093be012592cc5863e18ecfb1b" alt=""><figcaption><p><em><strong>Figure 6.</strong> Test call error</em></p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/skrypty-scriptservice/edytor-skryptow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
