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.


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$ – George Wolfe Jan 25 '18 at 20:57


AbsoluteCurrentValue[Notebooks[], WindowTitle]

work for you?

  • $\begingroup$ I knew there was an easy way. Thanks! $\endgroup$ – George Wolfe Jan 25 '18 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$ – Tugrul Temel Dec 10 '19 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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