# open()

Opens a file and replaces the current scene. Same as File > Open.

`.sls` opens a project. `.idt` opens an Init Dummy as a new scene. Any other extension, a missing file, or a folder is refused. A dirty scene needs `discard=True`.

A `.sls` file that fails the integrity check is not opened. The menu item "Open Anyway" is not available here. On Trial, `.idt` returns `trial_locked`.

### Signature
```python
api.open(path, discard=False) -> result
```

| Field | Meaning |
|---|---|
| `ok` | True on success. |
| `error` | Failure code. Empty on success. The path is not included. |
| `unsupported` | The extension is neither `.sls` nor `.idt`. |
| `bad_path` | Missing, a folder, or an empty path. |
| `dirty` | Pass `discard=True` to replace the scene. |
| `integrity` | The `.sls` integrity check failed. |
| `trial_locked` | Trial cannot open `.idt`. |

### Example
```python
result = api.open(r"D:/work/hero.sls", discard=True)
print(result.ok, result.error)
``