I've been redirecting outputs to a separate notebook using this simple code to modify the $Post variable:
nbout = CreateDocument[]
$Post = Function[expr, SelectionMove[nbout, Next, Cell];
NotebookWrite[nbout, Cell[BoxData@ToBoxes@expr, "Output"]]];
This works nicely except for code that does normally not generate output, i.e. lines with ";"
.
For those lines, a Null
output is generated in the nbout
notebook.
Is there a simple way to suppress this output?
Many thanks in advance for any advice.
If[expr === Null, ...]
. $\endgroup$