# Dynamic [ NotebookEvaluate [“_”] ]

A nice way to centralize various tasks in one notebook is the NotebookEvaluation function. For instance I can evaluate ten notebooks from a single notebook (e.g. allnotebooks.nb) like this:

NotebookEvaluation["nbpath_1.nb"]
NotebookEvaluation["nbpath_2.nb"]
...
NotebookEvaluation["nbpath_10.nb"]


I would like to update this automatically, e.g. every six hours, but it doesnt work. My idea is to create a master notebook with the following code (here: 15 seconds):

Dynamic[NotebookEvaluate[
"C:\\Users\\myname\\Desktop\\allnotebooks.nb"],
UpdateInterval -> 15]


And it works without using dynamic. Using dynamic gives the following error:

An unknown box name (ToBoxes) was sent as the BoxForm for the expression.
Check the format rules for the expression.


Does someone have an idea about the reason? Is Dynamic not an adequate function to do this?

Thanks a lot for any ideas!

P.S. I tested it with this code for the sub notebooks, e.g. for nbpath_1.nb:

path = "C:\\Users\\myname\\Desktop\\";
time = DateString[{"YearShort", "Month", "Day", "_", "Hour", "Minute",
"Second"}];
data = Table[RandomInteger[{1, 10}], {10}];
Export[path <> "nb1_" <> time <> ".xls", data];

-
I think you can check ScheduledTasks to manage repeated evaluation easily. –  Kuba Sep 5 '13 at 16:07
ScheduledTasks is more appropriate. Dynamic is for display. You could try Dynamic[NotebookEvaluate[ "C:\\Users\\myname\\Desktop\\allnotebooks.nb"];ExampleData[{"TestImage", "Lena"}], UpdateInterval -> 15] –  Rojo Sep 5 '13 at 16:45
ScheduledTasks works perfectly. Especially the RunScheduledTask option. Thanks a lot for your help! Patrick –  Patrick Bernhard Sep 6 '13 at 7:52

ScheduledTasks will be more convenient to manage this task. Just like:
RunScheduledTask[Print@DateList[], {3, 2}]

ScheduledTasks is more appropriate. Dynamic is for display. You could try Dynamic[NotebookEvaluate[ "C:\\Users\\myname\\Desktop\\allnotebooks.nb"]; ExampleData[{"TestImage", "Lena"}], UpdateInterval -> 15]