Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.5K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to create a notebook without save prompt?

Posted 3 years ago
POSTED BY: Werner Geiger
2 Replies
Posted 3 years ago

Basically this seems to work:

data = Style[Row[{"data = ", {1, 2, 4, 8, 16}}], Blue, Bold];

nb=CreateDocument[
  {TextCell["Some data","Chapter"],ExpressionCell[data,"Output"]}
];
SetOptions[nb, "ClosingSaveDialog" -> False];

SelectionMove[nb, After, Notebook];
NotebookWrite[nb, Cell[data2, "Output"]];

But it will not satisfy your wish below:

Only when the user edits the notebook himself, he should be prompted to save as usual.

POSTED BY: Hans Milton
Posted 3 years ago

Yes Hans, that's the problem. Actually, it's not severe. What I'm doing is:

  • Prepare the list of all cells
  • Use CreateDocument with that complete list.

Actually, I was just wondering where this "dirty-flag" is hidden, or how it can be controlled respectively.

POSTED BY: Werner Geiger
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard