5
$\begingroup$

I know that I can select individual evaluatable cells and disable their Open property (through Cell > Cell Properties), but is there a simple way to toggle the Open status of all evaluatable cells?

$\endgroup$
1

1 Answer 1

4
$\begingroup$

Something like this? (V9 and after only, because of Cells.)

toggleCellOpen[nb_: SelectedNotebook[]] :=
 (CurrentValue[#, CellOpen] = Not@CurrentValue[#, CellOpen]) & /@ 
   Select[Cells[], CurrentValue[#, Evaluatable] &]
$\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.