Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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];
share|improve this question
3  
I think you can check ScheduledTasks to manage repeated evaluation easily. –  Kuba Sep 5 '13 at 16:07
3  
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

1 Answer 1

Just for the record:

ScheduledTasks will be more convenient to manage this task. Just like:

RunScheduledTask[Print@DateList[], {3, 2}]

Also, Rojo said:

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.