MathGroup Archive 2008

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

Search the Archive

Re: Evaluating notebooks from other notebooks

  • To: mathgroup at
  • Subject: [mg86470] Re: Evaluating notebooks from other notebooks
  • From: David Bailey <dave at>
  • Date: Wed, 12 Mar 2008 00:11:28 -0500 (EST)
  • References: <fqtqme$d7q$> <fr2mfi$o3j$> <fr5e20$o7b$>

ag wrote:
> On Mar 10, 3:03 am, David Bailey <dave at>
> wrote:
>> ag 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.
>> Further to David Reiss's answer, I would just like to add that this is a
>> relatively unusual thing to wish to do. Using 6.0, .m files edit nicely
>> in the frontend, and it is usually more convenient to create a .m file -
>> xyz.m, and then execute it using Get["xyz.m"]
>> David Bailey
> The problem with autosave package is that it doesnot load all the
> contents (comments in particular).
> I have to convert everything to a code cell (Alt+8) to load all the
> variables from a .m file.
> Is there any way around it?
> -Ashutosh.
I am not entirely sure what you mean by this - maybe you are thinking 
about earlier versions of Mathematica. If you open a .m file into the 
frontend of 6.0 you can add heading or text cells to your code and save 
it away. What you get is a .m file in which all the non-executable stuff 
is hidden away as comments. The next time you open it, these comments 
are converted back into text/heading cells. I find this extremely 
useful. While a .m is open in the frontend, you can execute its code and 
view the output, but the output is not stored in the .m file (in this 
respect it differs from a notebook).

David Bailey

  • Prev by Date: Ping to Bob Hanlon, Andrzej K, others, re non-threading in cssmm with MTNW?
  • Next by Date: Re: NotebookOpen Function
  • Previous by thread: Re: Evaluating notebooks from other notebooks
  • Next by thread: Assignment problem: thanks for the many solutions!