NotebookObject

NotebookObject[id]

is an object that represents an open notebook in the front end.

Details

  • NotebookObject expressions are typically generated by kernel commands such as InputNotebook, EvaluationNotebook, and Notebooks.
  • id is a string that gives a UUID for the notebook that is globally unique. id typically corresponds to the notebook's ExpressionUUID.
  • NotebookObject[id,instance] includes a second UUID for instance that allows distinguishing notebooks using identical values of id, as may happen when working with a copied file.
  • NotebookObject may contain additional, implementation-dependent arguments.
  • In StandardForm and OutputForm, notebook objects are printed so as to indicate the current title of the window that would be used to display the notebook.
  • Functions such as NotebookPrint and NotebookClose take NotebookObject as their argument.
  • Within any open notebook, there is always a current selection. The current selection can be modified by applying functions such as SelectionMove to NotebookObject.
  • A NotebookObject typically remains valid if a notebook is closed and reopened.
  • Information for a NotebookObject may include the following properties:
  • "WindowTitle"notebook's window title
    "MemoryModificationTime"modification time stamp
    "ModifiedInMemory"whether the notebook has been modified since last save
    "StorageSystem"storage location for notebook
    "DocumentType"notebook type
    "MIMEType"application MIME type

Examples

open allclose all

Basic Examples  (1)

Functions that create notebooks return NotebookObject expressions:

Functions that act on notebooks take a notebook object as an argument:

Retitling a notebook changes the way the NotebookObject expression is displayed:

The NotebookObject expression itself has not changed:

Scope  (4)

There are several ways to obtain a NotebookObject:

Open a notebook from a file:

Use the NotebookObject to refer to the notebook in notebook operations:

Read selected data from the notebook:

Set options for the notebook:

Set options for the selected cell:

Insert new material into the notebook:

Save the notebook:

Close the notebook and delete the temporary file:

Get Information on a notebook object:

Use NotebookGet to get the underlying notebook expression:

Properties & Relations  (2)

The FullForm of a NotebookObject uses UUIDs to reference the cell:

Functions that create or open notebooks typically return the notebook's NotebookObject:

Possible Issues  (1)

After a notebook has been closed, the NotebookObject can no longer be manipulated:

Wolfram Research (1996), NotebookObject, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookObject.html (updated 2022).

Text

Wolfram Research (1996), NotebookObject, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookObject.html (updated 2022).

CMS

Wolfram Language. 1996. "NotebookObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/NotebookObject.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_notebookobject, author="Wolfram Research", title="{NotebookObject}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/NotebookObject.html}", note=[Accessed: 17-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_notebookobject, organization={Wolfram Research}, title={NotebookObject}, year={2022}, url={https://reference.wolfram.com/language/ref/NotebookObject.html}, note=[Accessed: 17-December-2024 ]}