Bug introduced in 8 or earlier and persisting through 11.3
The following behavior is stably reproduced with versions 8.0.4, 10.4.1, 11.0.1 and 11.1.1 on Windows 7 x64.
Set the NotebookDynamicExpression
:
SetOptions[EvaluationNotebook[],
NotebookDynamicExpression :> Refresh[nb = EvaluationNotebook[], UpdateInterval -> .1]]
Evaluate Dynamic[nb]
:
Dynamic[nb]
Everything is as expected so far. Now just select the code Dynamic[nb]
and copy it via Ctrl+C. Here is what becomes:
By evaluating nb
you occasionally can get the hidden NotebookObject
:
nb
This object isn't listed in Notebooks[]
:
Notebooks[]
What happens here? From where comes the hidden NotebookObject
? Why nb
periodically switches between the two NotebookObject
s? Is it a bug?
NotebookDynamicExpression
. $\endgroup$NotebookGet@ClipboardNotebook[]
returns a Notebook with theNotebookDynamicExpression
. Then it is certainly a bug, right? $\endgroup$nb
command returnsNotebookObject[16]
. I have recently played withNotebookDynamicExpression
andRefresh
and observed some strange similar switching effects in Dynamic but not very reproducible, i gave up. $\endgroup$NotebookGet@ClipboardNotebook[]
return a Notebook expression containing theNotebookDynamicExpression
? $\endgroup$