I have tried to insert the AutoCollapse command defined in this nice answer

How to Keep Input Cells Hidden After Evaluating Notebook

inside a Button

  Button["Input Délétion OK", 
  AutoCollapse[] := (If[$FrontEnd =!= $Failed, 
  SelectionMove[EvaluationNotebook[], All, GeneratedCell];

But AutoCollapse[] stay blue and unevaluated or is evaluated and then unevaluated --- MA 10.1. Any idea ?

  • $\begingroup$ What are you trying to accomplish? Do want a button that can enable and perhaps disable the action of having AutoCollapse[ ] as the last evaluation item in a multi-expression input cell? $\endgroup$
    – m_goldberg
    Nov 15 '16 at 15:36
  • $\begingroup$ Mainly, I want to hide the code, but I do not want to to it globaly but after verification of each input. $\endgroup$ Nov 15 '16 at 18:14
  • $\begingroup$ AutoCollapse is not defined unless you click a button. And button itself does not evaluate AutoCollapse[] so I'm quite confused why it was left outside. Can you clarify? $\endgroup$
    – Kuba
    Apr 13 '18 at 8:05

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.