SetSelectedNotebook[obj]
makes the notebook corresponding to obj be the currently selected one in the front end.
SetSelectedNotebook
SetSelectedNotebook[obj]
makes the notebook corresponding to obj be the currently selected one in the front end.
Details
- obj can be a NotebookObject or CellObject. If obj is a CellObject, then the notebook containing obj will be selected.
- Setting a particular notebook to be the currently selected one typically makes it the top notebook displayed on the screen.
- Making a notebook the currently selected one does not affect the current selection within that notebook, or within other notebooks.
Examples
open all close allBasic Examples (1)
Applications (1)
Create a palette for selecting from two existing notebook windows:
nb1 = CreateDocument[{a, b, c}, WindowTitle -> "First"];
nb2 = CreateDocument[{1, 2, 3}, WindowTitle -> "Second"];PaletteNotebook[{Button["Select 1", SetSelectedNotebook[nb1]], Button["Select 2", SetSelectedNotebook[nb2]]}]Properties & Relations (1)
SelectedNotebook gives you the notebook object for the selected notebook:
nb = CreateDocument[{a, b, c}]SetSelectedNotebook[nb];
SelectedNotebook[]The evaluation notebook can be different from the currently selected notebook:
SetSelectedNotebook[nb];
{SelectedNotebook[], EvaluationNotebook[]}See Also
Tech Notes
Related Guides
Related Workflows
- Find a Notebook's Notebook Object Identifier
History
Introduced in 1996 (3.0) | Updated in 2012 (9.0)
Text
Wolfram Research (1996), SetSelectedNotebook, Wolfram Language function, https://reference.wolfram.com/language/ref/SetSelectedNotebook.html (updated 2012).
CMS
Wolfram Language. 1996. "SetSelectedNotebook." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/SetSelectedNotebook.html.
APA
Wolfram Language. (1996). SetSelectedNotebook. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetSelectedNotebook.html
BibTeX
@misc{reference.wolfram_2026_setselectednotebook, author="Wolfram Research", title="{SetSelectedNotebook}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/SetSelectedNotebook.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_setselectednotebook, organization={Wolfram Research}, title={SetSelectedNotebook}, year={2012}, url={https://reference.wolfram.com/language/ref/SetSelectedNotebook.html}, note=[Accessed: 12-June-2026]}