NotebookSave[notebook]
saves the current version of the specified notebook.
NotebookSave[notebook,"file"]
saves the notebook in the specified file.
saves the current version of the current evaluation notebook in a file.
NotebookSave
NotebookSave[notebook]
saves the current version of the specified notebook.
NotebookSave[notebook,"file"]
saves the notebook in the specified file.
saves the current version of the current evaluation notebook in a file.
Details and Options
- notebook must be a NotebookObject expression. "file" should be an absolute pathname.
- NotebookSave[notebook] saves the notebook in a file whose name is given by the notebook object notebook.
- NotebookSave writes out the Wolfram Language expression corresponding to the notebook, together with Wolfram Language comments which make it easier for the front end to read the notebook in again.
- NotebookSave[notebook,"file"] overwrites file without warning if it exists.
- NotebookSave[notebook,File["file"]] is also supported.
- If the option setting Interactive->True is given, the front end will prompt the user to select a file name for the notebook.
Examples
open all close allBasic Examples (1)
Save a new document to a specified file:
nb = CreateDocument[{1, 2, 3}];NotebookSave[nb, FileNameJoin[{$TemporaryDirectory, "savetest.nb"}]]NotebookClose[nb]Modify a previously saved document and save it to the same place:
nb = NotebookOpen[FileNameJoin[{$TemporaryDirectory, "savetest.nb"}]];NotebookWrite[nb, Cell["0", "Output"]]NotebookSave[nb]NotebookClose[nb]Scope (1)
Options (1)
Interactive (1)
Use InteractiveTrue to prompt the user to select a file name for the notebook:
NotebookSave[Interactive -> True]Tech Notes
Related Guides
Related Workflows
- Programmatically Create a Notebook
History
Introduced in 1996 (3.0) | Updated in 2007 (6.0) ▪ 2012 (9.0) ▪ 2016 (11.0) ▪ 2023 (13.3)
Text
Wolfram Research (1996), NotebookSave, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookSave.html (updated 2023).
CMS
Wolfram Language. 1996. "NotebookSave." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/NotebookSave.html.
APA
Wolfram Language. (1996). NotebookSave. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookSave.html
BibTeX
@misc{reference.wolfram_2026_notebooksave, author="Wolfram Research", title="{NotebookSave}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/NotebookSave.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_notebooksave, organization={Wolfram Research}, title={NotebookSave}, year={2023}, url={https://reference.wolfram.com/language/ref/NotebookSave.html}, note=[Accessed: 13-June-2026]}