---
title: "The course script"
description: "The text format behind AI work in Open Learning Studio. What it is, what a small course looks like, and how to download and open it."
canonical_url: "https://docs.ols.yonn.online/en/ai/course-script"
---
# The course script

> The text format behind AI work in Open Learning Studio. What it is, what a small course looks like, and how to download and open it.

The **course script** is your course written as text. AI apps cannot look at the editor, but they read and write text very well. So the Studio can turn every course into a course script and turn a course script back into a course. That is how an AI reads your course and how it hands you a new one. You never have to write a course script yourself; this page is for the curious.

- **File name**: ends in `.olscript.json`.
- **Download**: on **My courses** in the course menu with **Export as course script (for AI)**, or in the **Connect AI** dialog with **Download course script**.
- **Open**: on **My courses** with **Open file**, or drag the file onto the page. It opens as a new course.

## Download and open in 4 steps

<procedure>

### Open My courses

Go to **My courses**. Every course in this browser is listed there.

### Download the course script

Open the menu of a course and choose **Export as course script (for AI)**. The Studio saves a `.olscript.json` file.

### Let the AI work on it

Attach the file in your AI chat and say what you want. Without MCP, also paste the **Instructions for the AI** from the dialog (see [Working with AI](https://docs.ols.yonn.online/en/ai/three-ways)).

### Open the result

Click **Open file** on **My courses** and pick the file the AI gave you. It opens as a new course; your original stays unchanged.

</procedure>

![The course script way in the Connect AI dialog with the buttons Download course script, Format reference, JSON Schema and Example course](https://docs.ols.yonn.online/screenshots/en/ai/course-script-way.png)

<hint-box kind="warning" title="Opened scripts are checked first">

The Studio checks every course script before it opens it, like every other import. JavaScript triggers are switched off after opening; only you can switch them on again in the course properties. If something in the file is wrong, the Studio tells you exactly where, often with a suggestion such as "Did you mean 'btn-next'?". Paste that message into your AI chat and ask the AI to fix the file.

</hint-box>

## What a course script looks like

Here is a complete tiny course: a welcome slide with a **Start** button, one question and a results slide.

```json
{
  "format": "open-learning-studio-script",
  "version": 1,
  "title": "Fire safety basics",
  "language": "en",
  "scenes": [
    {
      "key": "intro",
      "title": "Introduction",
      "slides": [
        {
          "key": "welcome",
          "title": "Welcome",
          "layout": "title",
          "heading": "Fire safety in 10 minutes",
          "subheading": "What to do when the alarm sounds",
          "objects": [
            { "type": "button", "key": "btn-start", "text": "Start", "place": "bottom-right" }
          ],
          "triggers": [
            { "when": { "type": "click", "object": "btn-start" }, "do": { "type": "nextSlide" } }
          ]
        },
        {
          "key": "exit-question",
          "title": "Exits",
          "question": {
            "type": "multipleChoice",
            "prompt": "Where do you go when the alarm sounds?",
            "choices": [
              { "text": "To the nearest marked exit", "correct": true },
              { "text": "To the elevator" },
              { "text": "Back to your desk" }
            ]
          }
        },
        { "key": "result", "title": "Result", "results": { "passPercent": 80 } }
      ]
    }
  ]
}
```

Read it like this:

<table>
<thead>
  <tr>
    <th>
      Part
    </th>
    
    <th>
      What it means
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        title
      </code>
      
      , <code>
        language
      </code>
    </td>
    
    <td>
      The course name and the language of its texts.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        scenes
      </code>
    </td>
    
    <td>
      The chapters of the course, each with its <code>
        slides
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      A short name for every part, for example <code>
        btn-start
      </code>
      
      . Triggers and questions point to each other by these names.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        layout
      </code>
      
      , <code>
        heading
      </code>
      
      , <code>
        subheading
      </code>
    </td>
    
    <td>
      A slide built from a layout, with its title texts.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        objects
      </code>
    </td>
    
    <td>
      Things on the slide: texts, shapes, buttons, images and more. <code>
        place
      </code>
      
       puts them at a named spot instead of exact positions.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        triggers
      </code>
    </td>
    
    <td>
      "When this happens, do that": here, a click on the button goes to the next slide.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        question
      </code>
    </td>
    
    <td>
      A question slide. The Studio adds the <strong>
        Submit
      </strong>
      
       button and the feedback on its own.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        results
      </code>
    </td>
    
    <td>
      A results slide with the passing score in percent.
    </td>
  </tr>
</tbody>
</table>

## Ground rules

- Leave out what you don't need: everything missing gets a sensible default.
- Every `key` is unique in the whole course and uses letters, digits, `-`, `_` and `.`.
- Times are in milliseconds (`1000` is one second), positions and sizes in pixels on the slide (normally 1280 x 720).
- Texts may use simple formatting: `**bold**`, `*italic*`, lists, links and variables such as `%Name%`.
- The field names are English; the texts are in the course language.

## The full reference

Everything the editor can do also exists in the course script: every object type, every trigger action and condition, all question types, themes, player settings, masters and question banks. The complete description is the **Format reference**. You find it in the **Connect AI** dialog under **Course script**, together with the **JSON Schema** (the exact rules for programs) and an **Example course** (the full "Example: IT basics" course as a script). AI apps with MCP read the same reference on their own.

<tip>

Want to see a big, well-built course script? Create a course from the template **Example: IT basics** and export it with **Export as course script (for AI)**.

</tip>

## If something doesn't work

**The Studio says the file is not valid.**
The message names the place and often the fix. Paste it into your AI chat and ask the AI to correct the file.

**The AI's answer is cut off.**
Big courses make long answers. Ask the AI to change one chapter at a time, or connect it with MCP (see [Connect your AI app](https://docs.ols.yonn.online/en/ai/connect-your-app)), so it doesn't have to send the whole course back.

**My JavaScript triggers stopped working after opening the file.**
That is intended. Check the code, then switch on **Allow JavaScript** in <ui-path path="View > Course">



</ui-path>

.


## Sitemap

See the full [sitemap](https://docs.ols.yonn.online/sitemap.md) for all pages.
