Mathematica Mathematica; NotebookEvaluate inside CreateDialog

  • Thread starter Thread starter ChristinaJ
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
A button window is created in Mathematica to select and run a notebook, but an error occurs during evaluation, stating "Could not process unknown packet '1'." This issue arises in Mathematica 8 across all platforms when using the NotebookEvaluate function within a CreateDialog. The problem was identified as being related to the Button implementation rather than the CreateDialog itself. A solution was found on Mathematica Stack Exchange, resolving the evaluation error. The discussion highlights the importance of understanding the interaction between different Mathematica functions.
ChristinaJ
Gold Member
Messages
34
Reaction score
1
The following creates a button window to select a notebook to run. When a button is pressed Mathematica finds the notebook but cannot evaluate it. The following error occurs
Could not process unknown packet "1"
Code:
CreateDialog[
  DialogNotebook[{Column[{TextCell[
       Row[{Style["I would like to ...", FontWeight -> Bold]}], 
       "Text"], 
      Row[{Button["run 1", 
         NotebookEvaluate[
          "/../file1.nb"]],
        Button["run 2", 
         NotebookEvaluate[
          "/../file2.nb"]],
        Button["run 3", 
         NotebookEvaluate[
          "/../file3.nb"]]}], Button["Done", DialogReturn[]]}]}]];
This occurs under Mathematica 8 on all platforms.

Any help greatly appreciated,
Christina
 
Physics news on Phys.org

Similar threads

Replies
1
Views
3K
Replies
2
Views
4K
Replies
3
Views
2K
Back
Top