Re: How do I script the evaluation of a Notebook
- To: mathgroup at smc.vnet.net
- Subject: [mg30532] Re: How do I script the evaluation of a Notebook
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Tue, 28 Aug 2001 04:54:36 -0400 (EDT)
- References: <9m6ted$l8f$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Matt, You need the FrontEnd Token, "EvaluateNotebook": nbe = Notebook[{Cell["2+3", "Input"] }, WindowTitle -> "temp" ]; nbo = NotebookPut[nbe]; FrontEndExecute[{FrontEndToken[nbo,"EvaluateNotebook"]}] For more on FrontEnd tokens see "The Beginner's Guide to Mathematica Version 4, by Jerry Glynn and Theodore Gray. -- Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 "Matthew D. Langston" <langston at SLAC.Stanford.EDU> wrote in message news:9m6ted$l8f$1 at smc.vnet.net... > How do I script the evaluation of a Notebook? > > I'd like to programmatically evaluate a Notebook multiple times in a loop. > Although I don't know how to write it, here is the Mathematic pseudo-code > that I'd like to learn how to write: > > nb = NotebookOpen["foo.nb"] > Do[NotebookEvaluate[nb], {myVar,4}] > > I made up the name "NotebookEvaluate" because it is not a real Mathematica > function, but it does describe what I want to do. Is there a function in > Mathematica that takes a Notebook expression and evaluate the entire > Notebook? Thanks for your help. > > Regards, Matt > > -- > Matthew D. Langston > SLD, Stanford Linear Accelerator Center > langston at SLAC.Stanford.EDU > >