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];
ScheduledTasks
to manage repeated evaluation easily. $\endgroup$ScheduledTasks
is more appropriate.Dynamic
is for display. You could tryDynamic[NotebookEvaluate[ "C:\\Users\\myname\\Desktop\\allnotebooks.nb"];ExampleData[{"TestImage", "Lena"}], UpdateInterval -> 15]
$\endgroup$