Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NotebookClose

  • To: mathgroup at
  • Subject: [mg86592] Re: NotebookClose
  • From: Albert Retey <awnl at>
  • Date: Fri, 14 Mar 2008 04:17:25 -0500 (EST)
  • References: <frclsc$rpn$>


> I have about 30 Mathematica windows open and I would
> like to close the windows with a specific title. I can
> get a listing of all the notebooks by using the
> command Notebooks[]. I can further get the information
> for all the notebooks by 
> Map[NotebookInformation[#], Notebooks[]]
> This gives information such as the WindowTitle,
> MemoryModificationTime and ModifiedInMemory.
> I would however, like to close the notebooks that have
> a WindowTitle as "temp" for example.
> Any suggestions would be great.

This gives the notebooks whose title start with "temp":

tempnbs = Select[
     ("WindowTitle" /. NotebookInformation[#]),
     StartOfString ~~ "temp" ~~ ___
     ] &

this closes all of them:

NotebookClose /@ tempnbs

if you are courageous, do it in one step. Maybe you also want to play 
with the StringPattern to fit your needs...



  • Prev by Date: Strange font problem
  • Next by Date: Re: Impedance Equation fit to Complex Data
  • Previous by thread: NotebookClose
  • Next by thread: Re: NotebookClose