From: Christoph Lhotka on
hi, a combination of the functions NotebookSave and EvaluationNotebook
should do the job.
e.g., inside your code, something like:

NotebookSave[EvaluationNotebook[],"dump.save.nb"]

will save the notebook of evaluation into the file "dump.save.nb"
whenever it is evaluated.

chr



Vince Virgilio wrote:
> On Feb 25, 7:41 pm, Joe Hays <joeh...(a)vt.edu> wrote:
>
>> Hello all,
>>
>> How can I get a notebook to programmatically save itself at controlled
>> locations? I don't want to use the NotebookAutoSave property because that
>> saves the notebook everytime a cell produces an output. I want more control
>> over when the notebook save itself.
>>
>> Ideas?
>>
>
> For a periodic save, perhaps some combination of Dynamic and Clock
> would do.
>
> In Doc Center, start here:
>
> ref/Clock
>
> Vince Virgilio
>
>
>
>


From: David Bailey on
Joe Hays wrote:
> Hello all,
>
> How can I get a notebook to programmatically save itself at controlled
> locations? I don't want to use the NotebookAutoSave property because that
> saves the notebook everytime a cell produces an output. I want more control
> over when the notebook save itself.
>
> Ideas?
>
>

Assuming your notebook is selected while it is executing (the usual case):

NotebookSave[SelectedNotebook[]]

However, I would be a bit cautious about doing this unless your notebook
just invokes code from elsewhere. If I had a notebook containing a
substantial amount of code, I'd want to be in charge when I saved it.
Murphy's law says that if you automate the process, something will go wrong!

David Bailey
http://www.dbaileyconsultancy.co.uk