# 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](/9.4/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](/9.4/ida-actions/snippetsclonecurrent.md) — duplicate the selected snippet;
* [Import from file...](/9.4/ida-actions/snippetsimportcurrent.md) / [Export to file...](/9.4/ida-actions/snippetsexportcurrent.md) — move snippets to and from disk;
* [Run current...](/9.4/ida-actions/snippetsruncurrent.md) — execute the selected snippet;
* [Change tab size...](/9.4/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](/9.4/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)

## Configuration

## Related topics

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


---

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