The notebook expression resulting from ...
nb = CreateDocument[ExpressionCell[Defer@Random[], "Input"]];
FrontEndTokenExecute[nb, "EvaluateNotebook"];
NotebookGet@nb
does not include the output of Random[] as I might have expected from the FrontEndTokenExecute command. Instead NotebookGet@nb acts as if FrontEndTokenExecute was not evaluated despite its execution in the frontend?
I guess this is due to the separation/communication between the frontend and the kernel but can output from evaluations in a generated notebook be grabbed in a single kernel call?
See answer below:
NotebookGet@nbreturns insteadNotebook[{Cell[BoxData[RowBox[{"Random", "[", "]"}]], "Input"]}, WindowSize -> {740, 752}, WindowMargins -> {{350, Automatic}, {Automatic, 50}}, FrontEndVersion -> "8.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (October 5, 2011)", StyleDefinitions -> "Default.nb"]? – Ronald Monson Nov 4 '12 at 23:51NotebookGet@nbin separate cell you get you expected output (perhaps confirming your guess?) – kguler Nov 5 '12 at 0:22