I want to display some data in a notebook created from scratch. I do not want the notebook to be saved, nor do I want the user to be prompted with the standard save dialog when closing the notebook. Only when the user edits the notebook himself, he should be prompted to save as usual.
If I create and write the notebook with one singe CreateDocument this works as desired:
data = Style[Row[{"data = ", {1, 2, 4, 8, 16}}], Blue, Bold];
nb = CreateDocument[{
TextCell["Some data", "Chapter"],
ExpressionCell[data, "Output"]}];
But if I write some more data into the notebook by NotebookWrite, the user will be prompted to save the notebook.
data = Style[Row[{"data = ", {1, 2, 4, 8, 16}}], Blue, Bold];
data2 = Row[{"Some more data = ", 4711}];
nb = CreateDocument[{
TextCell["Some data", "Chapter"], ExpressionCell[data, "Output"]}];
SelectionMove[nb, After, Notebook];
NotebookWrite[nb, Cell[data2, "Output"]];
There must some kind of "dirty-flag" for the notebook which is reset after CreateDocument and set after NotebookWrite. I would have to reset that flag after all my writing. But I cannot find how to reset that dirty-flag.
I assume it's some of the notebooks options, but I don't see something alike within option inspector.