({{, (RefLink[NotebookAutoSave, paclet:ref/NotebookAutoSave])
is a notebook option that specifies whether the notebook should automatically be saved after each piece of output generated by evaluation in it. }})

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Create a notebook with (RefLink[NotebookAutoSave, paclet:ref/NotebookAutoSave])->(RefLink[True, paclet:ref/True]) and save it to a file:

nb=CreateDocument[Map[ExpressionCell[Defer[#+#],"Input"]&,Range[3]],NotebookAutoSave->True];

fname=FileNameJoin[{$TemporaryDirectory,"autosave.nb"}];

NotebookSave[nb,fname]

Check the time of creation of the notebook file:

DateString[Date/.FileInformation[fname],"Time"]

When you evaluate an input, the notebook is automatically resaved:

SelectionMove[nb,Next,Cell];
SelectionEvaluate[nb]

This shows the newer modification time of the file:

DateString[Date/.FileInformation[fname],"Time"]

Close the notebook and delete the temporary file:

NotebookClose[nb];
DeleteFile[fname];

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NotebookSave, paclet:ref/NotebookSave])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Options for Notebooks, paclet:tutorial/OptionsForNotebooks])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Managing Computations in Notebooks, paclet:guide/ManagingComputationsInNotebooks])}, {▪(RefLinkPlain[Evaluation Options in Notebooks, paclet:guide/EvaluationOptionsInNotebooks])}, {▪(RefLinkPlain[Wolfram System Session History, paclet:guide/WolframSystemSessionHistory])}})}})