# Editing the script

> The block view and the code view, the parts panel, working with lines, ruby, and importing text

You can write the script in two views, "Blocks" and "Code." Both edit the same file, so you can switch at any time (⌘E).

## The block view

![The block view, with scene headings, colored command tags and dialogue with faces.](/shots/en/s-edit-blocks.webp)

- Labels become scene headings that show the scene's background.
- Commands such as backgrounds and sprites appear as colored tags.
- Dialogue appears with the speaker's face and name, and narration as plain text.
- Choices are grouped into a card. Click "→ #label" to go to that scene.

### The parts panel

Click "Parts" on the left edge of the script to open the parts panel. Parts are grouped into "Common," "Text," "Flow," "Backgrounds and screen," "Sprites," "Sound," "Motion" and "Progress and system," and "Common" also lists the parts you used recently. Type what you want to do in the box at the top, such as shake, fade to black or rain, to find the parts that fit.

- Hover over a part to see a description, an example and a moving preview.
- Double-click a part to add it after the selected line.
- Drag a part into the script to add it where you drop it.
- When you add a command such as a background or a sprite, the parameter panel opens on the right.

### Working with lines

| Task | How |
|---|---|
| Edit text | Click the selected line again to edit it in place. Enter adds a line break; ⌘Enter or clicking outside the line confirms; Esc cancels |
| Edit a command | Click its tag to open the parameter panel on the right |
| Change the speaker | Click the name on the dialogue line and choose from the list of speakers. You can also choose "Narration" |
| Change the expression | Click the face on the dialogue line and choose from the list of expressions. The `@chara` before that line is rewritten, or added if there isn't one |
| Move | Drag the handle at the left end of the line, or use ⌥↑ and ⌥↓ |
| Select a range | Drag anywhere except the handle, Shift-click, Shift+up or down, or ⌘A |
| Copy, cut, paste, duplicate | ⌘C, ⌘X, ⌘V, ⌘D |
| Delete | Delete, or the × at the right end of the line |

"Emphasize dialogue" next to the name on a dialogue line fades every line except that character's dialogue. It doesn't change the script.

### Right-clicking a line

Right-click a line, or click its "…," to see what you can do with it.

![The menu for a right-clicked dialogue line.](/shots/en/s-line-menu.webp)

| Item | What it does |
|---|---|
| Play from Here | Starts a test play from that line (⌘⌥P) |
| Go to Jump Target | Opens the scene that an `@jump` or choice line jumps to (F12) |
| Open character "Shiori" and so on | Opens the character, asset, scene or variable used on that line in its own screen |
| Add comment | Writes a review comment on that line (⌘⌥M) |
| Breakpoint | Stops the preview when it reaches that line |
| Bookmark | Marks the line (⌘⌥K) |
| Add to favorites | Lists it under "Favorites" at the top of the parts panel |

Right-click a scene heading to also see the scene commands ([Files and scenes](/en/guide/scenes/)).

## The code view

![The code view.](/shots/en/s-edit-code.webp)

Here you write the `.lim` text directly. As you type command names, parameters, labels, characters and asset names, suggestions appear. Mistakes get a wavy underline right away, with a suggested fix. The syntax is described in [Writing scenarios](/en/docs/design/format/).

- The vertical lines to the right of the line numbers show from which line to which line a background, BGM or sprite lasts. Hover over one to see the background or sprite image.
- ⌘-click a jump target to go to that scene.
- Keys for moving and duplicating lines, adding cursors and so on are the same as in VS Code ([Keyboard shortcuts](/en/guide/screen/)).

## Add ruby

Ruby is the small reading aid printed above Japanese characters. Select characters in the text and press ⌘⌥R to add ruby in the form `{r base|reading}`. If the glossary has a reading for the word, the reading is filled in. If not, the cursor moves to where you type the reading. In the block view, select the characters while editing the text and press the keys.

Choose "Add ruby from glossary readings" in the menu on the script heading to add ruby, scene by scene in the open file, to the first occurrence of each word that has a reading in the glossary.

## Import text

"Import text" in the menu that opens when you click the script heading (the file name) makes dialogue and narration lines in one go from text or a spreadsheet table.

![The Import text or a table screen.](/shots/en/s-import.webp)

- Lines in the form `Name "…"`, `【Name】…` or `Name: …` become dialogue, and other lines become narration.
- For a table, columns with headings such as "name" and "text" are read.
- Choose Ink, Yarn Spinner, Ren'Py or Twine (Twee 3) in "Format" to convert to `.lim` with labels, choices, conditions and variables. Drop a `.ink`, `.yarn`, `.rpy` or `.twee` file to have the format detected automatically.
- Parts that can't be converted are kept as comments, and the number of them is shown.
- Click "Insert after the cursor line" or "Make a new file" to bring the lines in. You can undo with ⌘Z.
