0
$\begingroup$

I've looked around the website and the documentation but I've had no success. The task is simple: I'm looking for a Mathematica command that evaluates all the initialisation cells in a given notebook, not necessarily at startup.

I'm imagining something along the lines of CellEvaluateAll["InitialisationCells"] (this is of course pseudocode) but I can't even find relevant documentation on this.

Is there any built in way to achieve this?

$\endgroup$
  • $\begingroup$ If you look at the bare menu on top of the notebook, you can go and click on the Evaluation option and you scroll you will find the option Evaluate Initialization Cells. Are you looking for something different than that? $\endgroup$ – Darth_Bane Feb 7 at 8:39
  • 1
    $\begingroup$ @Darth_Bane Yes. I'm looking for an in-line command. $\endgroup$ – OldTomMorris Feb 7 at 8:42
  • 1
    $\begingroup$ Is this the answer: mathematica.stackexchange.com/q/26123/5478? $\endgroup$ – Kuba Feb 7 at 8:45
  • $\begingroup$ @Kuba I don't believe so. Am I right in saying that this does not allow me to evaluate the initialisation cells in the actual notebook that I'm working in? I have tried but cannot get it to work. $\endgroup$ – OldTomMorris Feb 7 at 9:21
  • 3
    $\begingroup$ FrontEndTokenExecute["EvaluateInitialization"]; $\endgroup$ – Kuba Feb 7 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.