# Script Editing

Scripts take the operator or end-user through a series of questions until an outcome is achieved. Decision making by the Scripts is performed by responding to Answers and other factors that can control the flow of script, e.g. Databoxes. &#x20;

All Scripts (System, Master or Script Sets) are displayed and edited in the Scripting Grid. To edit, open the required Scripts, navigate to the Topic and click the Edit button. For new Topics, create the Topic first.

<div align="center"><figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2F3DrhX51feM6PG2wnZPsx%2F2023-04-21_12h56_46.png?alt=media&#x26;token=d49949d2-1a87-4a2f-bfd8-0b019505369f" alt=""><figcaption><p>The Scripting Grid</p></figcaption></figure></div>

As per the header, the grid contains:

**Script Step** – the questions and options displayed in a hierarchical tree structure

**Rec** – if checked, the selected response is recorded and added to the fault/enquiry description

**Act** – indicates the type of action. These can be any of:

<table><thead><tr><th width="100">Code</th><th>What it does</th><th data-hidden></th></tr></thead><tbody><tr><td>DBR</td><td>reads the contents of a Databox</td><td></td></tr><tr><td>DBW</td><td>writes to a Databox</td><td></td></tr><tr><td>LNK</td><td>Links to another script</td><td></td></tr><tr><td>MKR</td><td>denotes a Marker, used for deeper reporting</td><td></td></tr><tr><td>MSG</td><td>denotes a Message</td><td></td></tr><tr><td>PRI</td><td>sets a Priority</td><td></td></tr><tr><td>SVC</td><td>selects a Service code (aka SOR)</td><td></td></tr><tr><td>TSK</td><td>denotes a Task</td><td></td></tr></tbody></table>

**Action** – displays the selected Action

**Next Step** - indicates the next step to be taken from a drop down menu. This menu offers the following options:

<div align="center"><figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FCykpR9hLGLo6oYE8S66A%2Fmenu.png?alt=media&#x26;token=ea23164a-d397-427d-a7f4-1986fa219932" alt=""><figcaption><p>Next step menu</p></figcaption></figure></div>

<table><thead><tr><th width="131">Option</th><th>What is does</th><th data-hidden></th></tr></thead><tbody><tr><td>Next Step</td><td>simply jumps to the next step (nothing is displayed in the grid)</td><td></td></tr><tr><td>End</td><td>the Script finishes (will then return to any calling Script) </td><td></td></tr><tr><td>Cancel</td><td>the Script will be cancelled </td><td></td></tr><tr><td>Submit</td><td>this defines where a Script will terminate and navigate to the results page</td><td></td></tr><tr><td>>FL</td><td>jumps to another Script Type (in this example, the code 'FL' denotes a script type named 'Frontline', meaning the Enquiries Script Type)</td><td></td></tr><tr><td>Section 1</td><td>go to a declared section of Script (you can name these as you wish - meaningful names will add clarity to your script!)</td><td></td></tr></tbody></table>

### Adding Script Sections

To add a new script section edit the script then use the "Add" button within the toolbar to create a new script section. The new script section will appear at the very bottom of the script and the name can be changed by updating the section name displayed within the grid. Multiple Sections can be added.

### Quick Editing

Items that you wish to include in your script are normally created in advance. However, to assist with editing, by right clicking on the **Script Step** or **Action** columns, context menus can be viewed, which allows for the creation of a new items, or to edit an existing Entity or Action.

Right clicking the **Script Step** column displays this menu:

<div align="center"><figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FJLDyr4k04iCQ6ECSQuZM%2F2023-04-21_13h27_18.png?alt=media&#x26;token=8ab96691-187c-4244-a8ee-68e7391d80af" alt=""><figcaption><p>Quick Edit menu from the Script Step column</p></figcaption></figure></div>

...whereas right clicking in the **Action** column displays this menu:

<div align="center"><figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FeFg4VU55dMCSLRBujMqw%2F2023-04-21_13h30_06.png?alt=media&#x26;token=edd520fe-d129-4ba1-b940-f9bfe45fd42e" alt=""><figcaption><p>Quick Edit Menu from the Action column</p></figcaption></figure></div>

### Editing hints, tips & tricks

**Adding an Action** - if an Action is already in place against a Script Step, by dragging a new Action and holding the '**Shift**' key forces the original item down a step, to allow the new Action to be in the correct place.&#x20;

{% hint style="info" %}
**NOTE** Keep an eye on the area above the Script grid as guidance or errors will be displayed here as you manoeuvre elements of your script, e.g.

![](https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FQXyXPEK3mI3RJeiNoVfm%2F2023-04-24_10h25_29.png?alt=media\&token=4ae84ebb-ad73-4d47-bd2f-e66263ccad3c)
{% endhint %}

**Duplicating Actions** - by holding the '**Ctrl**' key and selecting a Message, Priority, Service Code or Task already being used, these can be duplicated and moved to other positions within the Script Grid.\
\
**Displaying Properties** - by **double clicking** on a script item a new tab will open that displays its current properties.\
\
**Reordering Sections** - a section can be moved in the Script Gird by clicking on the 'Action' Column and **dragging and dropping** it to the desired location. This can only be done above or below another whole section, rather then *within* a section. For clarity, Section headers are shaded and extend across the Script Grid.

### Undoing your changes

Once you have made changes to your script, by clicking the **Restore** button you will be prompted with this message:

<div align="center"><figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FRf3ObQerHfIg44FHdKxl%2F2023-04-24_10h40_15.png?alt=media&#x26;token=47c8d461-32f3-4950-ad00-f4724ec47d86" alt=""><figcaption><p>'Save changes'? prompt</p></figcaption></figure></div>

{% hint style="info" %}
Note that the **Restore** button is not an '**Undo**' button - all changes to to the script will be undone and the script will appear as it did when you began to edit it.
{% endhint %}

### Get and Set Master

You will normally create your scripts within Topics at the Master level. When assigning Topics to a Script Set, links to the associated Master topic will be auto-generated, e.g.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2Feaw8Z7yNtz1M5XD5J6yk%2FScript%20Set%20-%20Link%20to%20Master%204.4.7.png?alt=media&#x26;token=4a13b7ae-a689-4ada-8371-67770e9e5d27" alt=""><figcaption></figcaption></figure>

By clicking '**Get Master**' you will be prompted with this message:&#x20;

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FjouMjtAEBBUDJ3dqN6UV%2F2023-04-24_10h56_28.png?alt=media&#x26;token=0df92d09-9eb7-44ae-a1d9-f623d28635bb" alt=""><figcaption></figcaption></figure>

By clicking **Yes**, the Master Script steps will be copied into the grid, replacing the current contents of the grid.&#x20;

### Script Links - some rules

The available Script links are dependent on the Script Type. Please be aware of the following:

* Scripts within a Script Set can Link to Scripts within the same set, to Master and Systems Scripts
* System Scripts can only Link to Custom System Scripts
* Master Scripts can Link to Master Scripts and Custom System Scripts but not to Script Sets.


---

# Agent Instructions: 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:

```
GET https://docs.keyfax.biz/product-suite/admin/script-editing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
