MathGroup Archive 2012

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

Search the Archive

Fwd: Evaluation of a whole notebook from another one

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127585] Fwd: Evaluation of a whole notebook from another one
  • From: James Stein <mathgroup at stein.org>
  • Date: Sun, 5 Aug 2012 02:35:31 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20120804095845.B418A6766@smc.vnet.net> <CAKStUKqzkXeLFCeg9L5mOQ09TvQKZdOrbVbW=dufEMAQC+NO+A@mail.gmail.com>

OK, here is a routine I wrote before v8 came out, perhaps it will help:

(* Pre Mathematica v8 routine to evaluate notebooks in companion directory \
(likely equivaent to v8's NotebookEvaluate *)
ClearAll[evaluateNB];
evaluateNB[name_String, debug_Symbol: True] := Module[{path, nb},
   path = FileNameJoin[{NotebookDirectory[], name}];
   If[debug, Print["evaluating Notebook: ", path]];
   nb = NotebookOpen[path];
   If[True,(* pre Mathematica v8:
    evaluation was queued for later *)
    SelectionMove[nb, All, Notebook];
    SelectionEvaluate[nb];
    ];
   If[False,(* post Mathematica v8:
    immediate evaluation *)
    NotebookEvaluate[nb]
    ];
   NotebookClose[nb];
   ];

On Sat, Aug 4, 2012 at 9:42 AM, Dr. Robert Kragler <kragler at hs-weingarten.de
> wrote:

> **
> Hi,
>
> yes you are right, but this command is only available from Mathematica version 8,
> not in version 7 for which I have written my code (the procedures comprise
> more than 3000 lines and it is not trivial to use it in version 8). What I
> need is a workaround for version 7.
>
> Thanks for your reply and your interest in this matter.
>
> Regards
>                  Robert Kragler
>
> Am 04.08.2012 18:14, schrieb James Stein:
>
> You do indeed  "miss"  a command such as NotebookEvaluate.
> Mathematica has a command by that exact name!
> It appears to do just what you desire...
>
>
> --
> Dr. Robert Kragler
> Email : kragler at hs-weingarten.de
> URL : http://portal.hs-weingarten.de/web/kragler
>
>


  • Prev by Date: Re: Why no OSX SystemDialogInput["RecordSound"]?
  • Next by Date: Re: How to Extract Conditional Expression?
  • Previous by thread: Re: Evaluation of a whole notebook from another one
  • Next by thread: Re: Evaluation of a whole notebook from another one