I would like to be able to delete any open notebook with some specific text string in its name. Notebooks[] returns a list of open notebook objects, but to get the names, I am using a kluge involving


followed by using StringPosition[#,"WindowsTitle"] and then StringTake[] based on the string positions returned. When I get the exact name of the notebook of interest, it's easy to close it with NotebookClose[name].

I'll bet there is a very straightforward way to extract properties from notebook objects. But I can't find it.


2 Answers 2


If the open notebooks have already a filename (ie if they have been saved somewhere) :

NotebookFileName /@ Notebooks[]  

otherwise you can use :

NotebookInformation /@ Notebooks[]
  • $\begingroup$ It's so simple. Thanks again. $\endgroup$ Jan 25, 2018 at 20:57


AbsoluteCurrentValue[Notebooks[], WindowTitle]

work for you?

  • $\begingroup$ I knew there was an easy way. Thanks! $\endgroup$ Jan 25, 2018 at 20:56
  • $\begingroup$ @Carl Woll: Is there a way like your suggestion above to list the names of all the variables and tagged cells in a notebook? $\endgroup$ Dec 10, 2019 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.