NotebookEvaluate
Wolfram Kernel
Execution environment
NotebookEvaluate[_RemoteNotebook] _
evaluates the content of provided RemoteNotebook following the rules:
- all initialization cells are evaluated in the isolated context on the same caller kernel
- the output of the last input Wolfram cell is returned
warning
NotebookEvaluate breaks the evaluation order and causes the evaluation of the host cell one more time. Please consider to switch to NotebookEvaluateAsync, which is much safer and more predictable
For example, one can use it to import some definitions from other notebooks like a small "module" using a standard importer:
nb = Import["someStuff.wln", "WLN"];
{Symbol1, Symbol2} = NotebookEvaluate[nb];
where at someStuff.wln you may have:
cell -1
{1+1, Plot[x, {x,0,1}]}