NotebookFileName

NotebookFileName[]

gives the file name of the current evaluation notebook.

NotebookFileName[nb]

gives the file name for the notebook specified by nb.

Details

  • NotebookFileName returns the absolute file name for the notebook as a string.
  • NotebookFileName gives $Failed if the specified notebook has never been saved as a file.
  • The file name given by NotebookFileName is on the filesystem of the computer on which the notebook front end is being run.

Examples

Basic Examples  (1)

Create a notebook, save it in a file, and then open it:

Find the file name for the notebook:

Close the notebook and delete the file:

Wolfram Research (2008), NotebookFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookFileName.html.

Text

Wolfram Research (2008), NotebookFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookFileName.html.

BibTeX

@misc{reference.wolfram_2020_notebookfilename, author="Wolfram Research", title="{NotebookFileName}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/NotebookFileName.html}", note=[Accessed: 14-May-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_notebookfilename, organization={Wolfram Research}, title={NotebookFileName}, year={2008}, url={https://reference.wolfram.com/language/ref/NotebookFileName.html}, note=[Accessed: 14-May-2021 ]}

CMS

Wolfram Language. 2008. "NotebookFileName." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NotebookFileName.html.

APA

Wolfram Language. (2008). NotebookFileName. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookFileName.html