> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/core/user-interface/concepts/scripts-window.md).

# Scripts window

The Scripts window is IDA's home for running and managing scripts. It is a dockable window organized into four vertical tabs — **Snippets** (stored in the IDB), **Recent scripts** (external files), **Examples** and **Search** — each backed by its own tree of scripts and a shared editor pane.

![The Scripts window, showing the Snippets tab](/files/uJxV8h11KLaYRfnwor1e)

## Overview

The window is split into three areas:

* the **vertical tab strip** on the left, selecting the active source (Snippets, Recent scripts, Examples, Search);
* the **source tree**, listing the scripts of the active tab — with a **Last run** column showing when each entry was last executed (hover for the absolute timestamp);
* the **editor pane**, showing the selected script, together with a language indicator and run controls.

The dock title reflects the active tab (for example `Scripts - Snippets`), and the active tab is remembered across desktop save/restore.

## Invocation

* Open it from the **View** menu, or press <kbd>Alt</kbd>+<kbd>F9</kbd> ([Recent scripts](/ida-actions/recentscripts.md)) to open it directly on the **Recent scripts** tab.
* The window is dockable; it can be tabbed or floated like any other IDA widget.

## Tabs

### Snippets

Snippets are short scripts stored inside the IDB, so they travel with the database. They are editable in place, and the tab remembers the last-selected snippet and a per-IDB tab size.

When no database is loaded, the tab works in **scratch** mode, backed by an implicit default snippet, so snippets can still be edited and run.

#### Managing snippets

The snippet toolbar / context menu provides:

* [Clone](/ida-actions/snippetsclonecurrent.md) — duplicate the selected snippet;
* [Import from file...](/ida-actions/snippetsimportcurrent.md) / [Export to file...](/ida-actions/snippetsexportcurrent.md) — move snippets to and from disk;
* [Run current...](/ida-actions/snippetsruncurrent.md) — execute the selected snippet;
* [Change tab size...](/ida-actions/snippetschangetabsize.md) — set the editor's tab width.

![The Snippets context menu](/files/1j2XSyaMFoRcYSQL61tF)

### Recent scripts

The external script files you have run, tracked by their path on disk. Each row carries a language icon (Python or IDC), and single-child folder chains are coalesced so the tree stays shallow. Entries are shown read-only in the editor; from here you can run them or [import them as snippets](#import-as-snippet).

![The Recent scripts tab](/files/NlpsDYVkNsXjzf9nA3zc)

### Examples

The IDAPython examples shipped with IDA, browsable directly inside the window. Like Recent scripts, entries are read-only and can be run or imported as snippets.

![The Examples tab](/files/5wxiUouc7vwyQCnUTWk4)

### Search

Searches across all three sources — Snippets, Recent scripts and Examples — at once. Selecting a hit previews it, with the matching line highlighted in the editor.

![The Search tab, with a hit selected and its matching line highlighted](/files/bZDCi6aLcUL2ePUIr3Im)

Double-clicking a hit (or pressing <kbd>Enter</kbd>) jumps to its native tab, scrolled to the matched line.

![Activating a hit jumps to its source tab](/files/r6Q2fkS1250528bPlPyR)

## Running scripts

A selected entry can be run by pressing <kbd>Enter</kbd>, double-clicking it, or using the **Run** control. The **Last run** column records when each entry was last executed. Snippets run with or without a database (see scratch mode above).

## The editor

The editor shows the selected script. Snippets are editable; Recent scripts and Examples are shown read-only. A language indicator shows the script's interpreter (Python or IDC) — editable for snippets, fixed for the other sources. Press <kbd>Ctrl</kbd>+<kbd>Space</kbd> for auto-completion while editing; the completion list is dismissed with <kbd>Esc</kbd>, and pressing <kbd>Ctrl</kbd>+<kbd>Space</kbd> again brings it back.

![Auto-completion in the editor](/files/SkXgCbr4v7xooH5hZskI)

## Import as snippet

From the **Recent scripts** or **Examples** tab, [Import as snippet](/ida-actions/scriptsimportassnippet.md) copies the selected script into a new snippet and selects it on the **Snippets** tab, so it can be edited and kept with the database.

![Import as snippet in the Recent scripts context menu](/files/nZZFY4wRorc5wotkccAa)

![The imported script, now an editable snippet on the Snippets tab](/files/TafqM1zGQr7V8Yfnt7bQ)

## Export for headless use

From the **Snippets** tab, **Export Headless...** saves the selected snippet to a file on disk, in a headless form. Then, the exported script can be run directly with [idalib](/core/idalib/getting-started.md), no IDA GUI required.

To do so, it prepends an auto-generated prologue that opens the current database via idalib.

```python
# Auto-generated 'headless' prologue
import idapro
idapro.open_database(r"/path/to/file.i64", run_auto_analysis=True)
```

## Configuration

## Related topics

* [IDAPython examples](/developer/idapython/idapython-examples.md)
* [IDC examples](/developer/idc/idc-examples.md)
* [Script command...](/ida-actions/executeline.md) — the command-line input line at the bottom of the IDA window.


---

# 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.hex-rays.com/core/user-interface/concepts/scripts-window.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.
