5

How can I create the "Run all code" button (at the top right corner) in Mathematica notebook?

The current method I have is to save the .nb file into .wls (i.e. Wolfram Language Script), and then open the .wls file (which have a "Run all code" button at the top right corner) and save it back to .nb file. But this method seems silly and clumsy and I wonder if there's a better method to do it.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
H42
  • 3,469
  • 7
  • 17

1 Answers1

8

Here is some code I wrote to make a palette that I use a lot. Maybe the it will work you, or at least give you ideas on how to do it.

CreatePalette[
  Framed @ Column[{
     Button["Evaluate Cells", 
       FrontEndExecute[FrontEndToken["EvaluateCells"]], 
       Appearance -> "Palette", ImageSize -> 140],
     Button["Evaluate Notebook", 
       FrontEndExecute[FrontEndToken["EvaluateNotebook"]], 
       Appearance -> "Palette", ImageSize -> 140],
     Button["Global Clear", Clear["Global`*"],
       Appearance -> "Palette", ImageSize -> 140]}],
  WindowTitle -> "Evaluation"];

palette

If you need instructions on how to install the palette, look at this answer.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257