I know how to run multiple notebooks at once. But my problem is that due to the RAM capacity, I have to run these notebooks consecutively. Another problem is that since I may not be in my office all the time, I want these notebooks to be run automatically. For example, notebook1 is evaluated, then notebook2 is evaluated, and so on.
Is there any way to do this? Any idea would be appreciated.
Answer
If you really need to do everything in the frontend, then I would Suggest the below procedure, in this process Mathematica would open a new window selects all the cells and runs them then it would go for the second notebook file
nb1 = NotebookOpen["/Users/you/Documents/1.nb"];
SelectionMove[nb1, All, Notebook]
SelectionEvaluate[nb1]
nb1 = NotebookOpen["/Users/you/Documents/2.nb"];
SelectionMove[nb1, All, Notebook]
SelectionEvaluate[nb1]
Hope this will help
Second Approach
If you are using OS X you can use the shell script
first give the path to the Mathematica then run the kernel to run your scripts remember you need to save them as .m files as save as option wont work alone you have to convert them to standard form cmd+8 in OS X if I'm not wrong.
math=/Applications/Mathematica.app/Contents/MacOS/MathKernel
"$math" -script 1.m
"$math" -script 2.m
And you need complete path to .m files by the way!
Comments
Post a Comment