NotebookGet[obj]
gets the raw expression corresponding to the notebook represented by the notebook object obj.
gets the raw expression corresponding to the currently selected notebook.
NotebookGet
NotebookGet[obj]
gets the raw expression corresponding to the notebook represented by the notebook object obj.
gets the raw expression corresponding to the currently selected notebook.
Details and Options
- NotebookGet allows you to take a notebook that is open in the front end, and get the raw expression corresponding to it in the kernel.
- NotebookGet returns an expression with head Notebook, containing Cell expressions and boxes data.
- NotebookGet[NotebookOpen[file]] returns the same expression as Get[file].
Examples
open all close allBasic Examples (1)
Applications (1)
nb = NotebookPut[Notebook[{Cell["Mathematical Constants", "Subsection"], Cell["pi", "Text"]}]];Cases[NotebookGet[nb], Cell[t_, "Subsection", ___] :> t, Infinity]Change Subsection-style cells to Section style:
NotebookPut[NotebookGet[nb] /. Cell[c_, "Subsection", o___] :> Cell[c, "Section", o], nb];Properties & Relations (1)
NotebookRead reads only the selected part of a notebook:
nb = NotebookPut[Notebook[{Cell["first", "Text"], Cell["second", "Text"]}]];SelectionMove[nb, Next, Cell]NotebookRead[nb]NotebookGet always gets the whole notebook:
NotebookGet[nb]Tech Notes
Related Guides
Related Workflows
- Import Material from a Notebook
History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), NotebookGet, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookGet.html.
CMS
Wolfram Language. 1996. "NotebookGet." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NotebookGet.html.
APA
Wolfram Language. (1996). NotebookGet. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookGet.html
BibTeX
@misc{reference.wolfram_2026_notebookget, author="Wolfram Research", title="{NotebookGet}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/NotebookGet.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_notebookget, organization={Wolfram Research}, title={NotebookGet}, year={1996}, url={https://reference.wolfram.com/language/ref/NotebookGet.html}, note=[Accessed: 12-June-2026]}