[Date Index] [Thread Index] [Author Index]
Re: How to close down the front end from a 3.0 notebook ?
Risto Karjalainen wrote: > > Here's the problem: I need to save my work and close the front end from > within a notebook. Strictly speaking, closing down the front end is not > essential. What I need to do is to save my notebook, close down the kernel, > and close the notebook, all using kernel or front end commands in the > notebook (i.e. with no keyboard input). Is there a way to do this in > version 3.0 ? > ... > Basically, my notebook looks as follows... > ... lots of stuff deleted ... > NotebookSave[SelectedNotebook]; > Exit; > NotebookClose[SelectedNotebook]; > Of course, the problem is that once you do Exit, there is no kernel left > to do NotebookClose. > ... I was able to do this successfully with the code (NotebookSave[EvaluationNotebook,"savedNotebook.nb"]; NotebookClose[EvaluationNotebook];Exit;) I think the front end sends the entire expression to the kernel before evaluation is done, so once it is all sent to the kernel, there is no more need for the notebook, and the Exit gets executed. -- ----------------------------- Dick Zacher Performance Engineering Dept., Tandem Computers zacher_dick at tandem.com phone: 408-285-5746 fax: 408-285-7079