To operate on a notebook programmatically, you usually need to know the corresponding NotebookObject identifier. Here is how to find the NotebookObject that corresponds to a given notebook window.

For the Notebook That Contains the Evaluation...

Get the NotebookObject of the notebook that contains the evaluation

EvaluationNotebook returns the NotebookObject identifier of the notebook in which it is evaluated:

Use the NotebookObject in a computation

Get the filename of the evaluation notebook:

For a Given Notebook on the Screen...

Get the list of currently open notebooks

Get the list of the currently open notebooks. The output indicates notebooks by window title:

Index the notebook list with the position of the notebook you want

Find the position of the notebook you want in the list. Use the position as an index to pull out the notebook you wantfor example, the World Time notebook:

Use the NotebookObject in a computation

Get the directory that contains the World Time notebook:

Get the NotebookObject of the notebook that contains the evaluation

EvaluationNotebook returns the NotebookObject identifier of the notebook in which it is evaluated:

Use the NotebookObject in a computation

Get the file name of the evaluation notebook:

Get the NotebookObject of the notebook that contains the evaluation

EvaluationNotebook returns the NotebookObject identifier of the notebook in which it is evaluated:

Use the NotebookObject in a computation

Get the filename of the evaluation notebook: