Re: Evaluating notebooks from other notebooks
- To: mathgroup at smc.vnet.net
- Subject: [mg86425] Re: Evaluating notebooks from other notebooks
- From: ag <ashutoshgupta.umd at gmail.com>
- Date: Tue, 11 Mar 2008 02:57:30 -0500 (EST)
- References: <fqtqme$d7q$1@smc.vnet.net> <fr0cq4$eal$1@smc.vnet.net>
Thanks everyone for the illuminating answers.
Just in case anyone needs it, here is what I could do last weekend
(using some help from an earlier post here):
EvaluateNotebook[notebookAddress_String] :=
Module[{nb}, nb = NotebookOpen[notebookAddress];
FrontEndExecute[FrontEndToken["EvaluateNotebook"]];
NotebookClose[nb];]
EvaluateNotebook::usage =
"EvaluateNotebook[notebookAddress_String] evaluates the notebook at
\
the notebookAddress." ;
-Ashutosh.
On Mar 10, 3:05 am, David Reiss <dbre... at gmail.com> wrote:
> Self grammar correction!
>
> StringReplace[ previous post, "it's" -> "its"]
>
> I certainly know better and Stephen Luttrell reminded me that I do
> know better (he cited precious things that I've written).
>
> But I posted **very** late...
>
> :-)
>
> --David
>
> On Mar 9, 6:05=A0am, David Reiss <dbre... at gmail.com> wrote:
>
> > 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.