Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to wait for command completion?

1 view
Skip to first unread message

congruenti...@yahoo.com

unread,
Jan 5, 2009, 3:28:43 AM1/5/09
to
Hello MathGroup:

I am automating the execution of a notebook. I use the following
commands (in a single cell).

t0 = NotebookOpen[<<file Name>>];
SetSelectedNotebook[t0];
FrontEndExecute@FrontEndToken["SelectAll"];
FrontEndExecute@FrontEndToken["EvaluateCells"];
NotebookSave[t0,<<Another fileName>>];
NotebookClose[t0];

These commands work correctly but the NotebookSave[] command executes
before the completion of the "EvaluateCells" invocation. If I re-
invoke the NotebookSave[], after the evaluation completes, it all
works fine.

Is there a way to make the NotebookSave[] wait for completion of
EvaluateCells?

TIA.

Regards...

Roger Williams
Franklin Laboratory

0 new messages