Re: Evaluating notebooks from other notebooks
- To: mathgroup at smc.vnet.net
- Subject: [mg86370] Re: Evaluating notebooks from other notebooks
- From: David Reiss <dbreiss at gmail.com>
- Date: Sun, 9 Mar 2008 05:06:20 -0500 (EST)
- References: <email@example.com>
One of the ways of doing this is to open the notebook with the Option Visible->False, execute it's cells, and then close the notebook. Here is an example (of course use your own path to the file in question): file = "/Users/dreiss/Desktop/test.nb"; nb = NotebookOpen[file, Visible -> False]; SelectionMove[nb, All, Notebook]; SelectionEvaluate[nb]; NotebookClose[nb]; If you want to save the notebook then you will need to do a bit more, ultimately using the function Export. I hope this helps... --David A WorkLife FrameWork E x t e n d i n g MATHEMATICA's Reach... http://scientificarts.com/worklife/ On Mar 8, 5:44=A0am, ag <ashutoshgupta.... at gmail.com> wrote: > Hi, > I was wondering if it is possible to evaluate a notebook, say > "xyz.nb" (without loading it in the front end), from another notebook > (say "root.nb") using some command like: > > EvaluateNotebook["xyz.nb", path] > > TIA, > Ashutosh. > PS: I am using Mathematica 6.0.1.