1
$\begingroup$

I am trying to create a setup where I have a number of InputField, SetterBar, and Checkbox with Dynamic in the first cell of my notebook where I can set some options/values, and then have a Button which executes the initialization cells once these parameters have been chosen.

I was trying to understand how to use FrontEndTokenExecute["EvaluateInitialization"], but when I put this in a cell and run it, I get the following output and the evaluation cells don't get executed, let alone when I put it inside of a Button (in which case nothing happens at all):

RefLink[TextCell[ RawBoxes["FrontEndToken"]], paclet : ref/FrontEndToken]["EvaluateInitialization"]

which looks like this enter image description here


Problem solved: I had copied and pasted the FrontEndTokenExecute out of the Mathematica documentation window and it copied as a hyperlink, thus the RefLink. Replacing it with plain text fixed it and the button works as expected.

$\endgroup$

1 Answer 1

3
$\begingroup$

Try this:

Button[Style["Before reading this notebook, press me", Bold, 
  Darker@Red], 
 FrontEndExecute[FrontEndToken["EvaluateInitialization"]]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.