# Keyboard shortcut to evaluate notebook

(If this is entirely trivial, although I couldn't find an answer as much as I searched the archives, I will delete the question.)

How could I add a keyboard shortcut to evaluate the entire notebook instead of going to Evaluation -> Evaluate Notebook again and again ?

-
I would post in answer, but I haven't tried it. Check out [customizing Mathematica shortcuts] (stackoverflow.com/questions/4209405/…) with the token EvaluateNotebook similar to the EvaluatorQuit demonstrated –  Timothy Wofford Sep 29 at 14:48
Thanks; I added it (EvaluateNotebook), but it enters an infinite loop. Also there are a couple of links in answer, that are no longer available. –  Zet Sep 29 at 15:02
How about Command-A followed by enter? –  bill s Sep 30 at 3:21

Presonally I would use what bill_s suggested, Ctrl+A followed by Shift+Enter.

But if you want to have one shortcut you can use what Timothy linked. Just add this line to the KeyEventTranslations.tr file:

 Item[KeyEvent["h", Modifiers -> {Control}],
FrontEndExecute[FrontEndToken[SelectedNotebook[ ], "EvaluateNotebook"]]]


it works for me.

Your infinite loop probably showed while testing on the notebook. Well, if you want to evaluate notebook and the last line is

FrontEndTokenExecute["EvaluateNotebook"]


then it will definitelly result in such loop.

-
Thanks @kuba! I will check the solution you propose and I will accept your answer later today. –  Zet Oct 2 at 12:19