I have a code like this:
namep = StringJoin[name, ".pdf"];
nb1 = NotebookOpen[alg];
SelectionMove[nb1, All, Notebook];
FrontEndTokenExecute[nb1, "EvaluateNotebook"];
Do[Print[TabView[{datos -> grad[[i]], Graficos -> graf[[i]],
Correlaciones -> grac}]], {i, diamindd, diamaxdd, step}];
But the Do instruction begins when the nb1 is still working and the print does not produce any: Part::partd: Part specification grad[[1]] is longer than depth of object.
How I can solve this?
Thanks