---
title: "InputNotebook"
language: "en"
type: "Symbol"
summary: "InputNotebook[] gives the current notebook into which keyboard input in the front end will be directed."
keywords: 
- focus notebook
- input focus
- keyboard notebook
- target notebook
canonical_url: "https://reference.wolfram.com/language/ref/InputNotebook.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Low-Level Notebook Programming"
    link: "https://reference.wolfram.com/language/guide/LowLevelNotebookProgramming.en.md"
related_workflows: 
  - 
    title: "Create a Palette"
    link: "https://reference.wolfram.com/language/workflow/CreateAPalette.en.md"
  - 
    title: "Add Styling to Text"
    link: "https://reference.wolfram.com/language/workflow/AddStylingToText.en.md"
  - 
    title: "Change the Background Color of a Cell"
    link: "https://reference.wolfram.com/language/workflow/ChangeTheBackgroundColorOfACell.en.md"
  - 
    title: "Put a Frame around a Cell"
    link: "https://reference.wolfram.com/language/workflow/PutAFrameAroundACell.en.md"
  - 
    title: "Put a Dingbat on a Cell"
    link: "https://reference.wolfram.com/language/workflow/PutADingbatOnACell.en.md"
related_functions: 
  - 
    title: "Notebooks"
    link: "https://reference.wolfram.com/language/ref/Notebooks.en.md"
  - 
    title: "SelectedNotebook"
    link: "https://reference.wolfram.com/language/ref/SelectedNotebook.en.md"
  - 
    title: "EvaluationNotebook"
    link: "https://reference.wolfram.com/language/ref/EvaluationNotebook.en.md"
  - 
    title: "ButtonNotebook"
    link: "https://reference.wolfram.com/language/ref/ButtonNotebook.en.md"
related_tutorials: 
  - 
    title: "Manipulating Notebooks from the Kernel"
    link: "https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#29688"
---
# InputNotebook

InputNotebook[] gives the current notebook into which keyboard input in the front end will be directed.

## Details

* ``InputNotebook`` returns a ``NotebookObject``.

* If there is no current input notebook, ``InputNotebook[]`` will return ``\$Failed``.

* The current input notebook is the notebook to which textual commands in the front end are normally directed.

* A palette window can be a currently selected notebook but cannot normally be an input notebook.

---

## Examples (3)

### Basic Examples (1)

Give the notebook object for the current input notebook:

```wl
In[1]:= InputNotebook[]

Out[1]= NotebookObject[(* InputNotebook.nb *)]
```

Perform additional operations:

```wl
In[2]:= Options[%, WindowSize]

Out[2]= {WindowSize -> {720, 734}}
```

### Properties & Relations (1)

The notebook that starts an evaluation might not be the input notebook:

```wl
In[1]:=
nb = CreateDocument["document"];
{InputNotebook[], EvaluationNotebook[]}

Out[1]= {NotebookObject[FrontEndObject[LinkObject["u9ead_shm", 3, 1]], 117], NotebookObject[(* InputNotebook.nb *)]}
```

### Possible Issues (1)

Both programmed operations and user interactions can change which notebook is taking input:

```wl
In[1]:= nb = CreateDocument[{a, b, c}, WindowTitle -> "Other"];

In[2]:=
(SetSelectedNotebook[EvaluationNotebook[]];snb1 = InputNotebook[];
	SetSelectedNotebook[nb];snb2 = InputNotebook[];)

In[3]:= "WindowTitle" /. NotebookInformation /@ {snb1, snb2}

Out[3]= {"InputNotebook.nb", "Other"}
```

## See Also

* [`Notebooks`](https://reference.wolfram.com/language/ref/Notebooks.en.md)
* [`SelectedNotebook`](https://reference.wolfram.com/language/ref/SelectedNotebook.en.md)
* [`EvaluationNotebook`](https://reference.wolfram.com/language/ref/EvaluationNotebook.en.md)
* [`ButtonNotebook`](https://reference.wolfram.com/language/ref/ButtonNotebook.en.md)

## Tech Notes

* [Manipulating Notebooks from the Kernel](https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#29688)

## Related Guides

* [Low-Level Notebook Programming](https://reference.wolfram.com/language/guide/LowLevelNotebookProgramming.en.md)

## Related Workflows

* [Create a Palette](https://reference.wolfram.com/language/workflow/CreateAPalette.en.md)
* [Add Styling to Text](https://reference.wolfram.com/language/workflow/AddStylingToText.en.md)
* [Change the Background Color of a Cell](https://reference.wolfram.com/language/workflow/ChangeTheBackgroundColorOfACell.en.md)
* [Put a Frame around a Cell](https://reference.wolfram.com/language/workflow/PutAFrameAroundACell.en.md)
* [Put a Dingbat on a Cell](https://reference.wolfram.com/language/workflow/PutADingbatOnACell.en.md)

## History

* Introduced in 1996 (3.0)