I have a Mathematica 6 course that I am using in Mathematica 9; there is no updated version. Every time I open a notebook I have to go to the Evaluation menu and click on "Evaluate Notebook". Is there a way for me to set it so that it automatically evaluates a notebook upon my opening it? I keep getting answers on shortcuts I can use once the notebook is open or pressing shift-enter on a cell but that's not an answer; I would like not to do anything at all other than open the notebook and have every cell evaluated already since the tutorial course is long and contains a ton of notebooks.
One thing you could do would be to make a master notebook with lots of
commands. Then execute all the ones you'll need at the start in one group. Then when you open them, they'll already be evaluated. You could do this programmatically by reading in and evaluating all the notebooks in a directory.
With the option inspector (shiftctrlO) you can set the value of the option
True (make sure that you select "Global Preferences"). Setting
False suppresses the dialog you would normally get. Please note that this may entail a potential security issue.
You can do it programmatically as well:
SetOptions[$FrontEndSession, InitializationCellEvaluation -> True, InitializationCellWarning -> False ]
$FrontEndSession here, so that the effect lasts for the session only (safer), but if you want to make this more permanent you could change that to
Assuming that you have all the notebooks in one directory
dir, you could open and evaluate them all at once by using:
NotebookEvaluate /@ NotebookOpen /@ FileNames["*.nb", dir]