Scheduled Macros: Let Your Macros Work While You Don't

December 05, 2026

Scheduled macros banner

Macros have always been something you start: click a ribbon button, pick a menu item, press a shortcut. That is great when you know exactly when you want something done. But a lot of useful work in OneNote is repetitive and predictable: tidying up a page after you edit it, creating tomorrow's planner page before you sit down at your desk, or refreshing something every hour.

Today we are introducing Scheduled Macros. A macro can now ask to be run automatically, on a schedule you approve, while OneNote is open. There is also a new place in Onetastic options where you can see every schedule, check what happened on each run, and turn schedules off when you no longer need them.

To show what this makes possible, we are also releasing updates to two macros that use it: TOC in Current Page and Daily Planner Page.

TOC in Current Page: A Table of Contents That Keeps Itself Fresh

The TOC in Current Page macro builds a table of contents at the top of your page, with links that jump to each heading. Until now, you had to run it again every time you added or renamed a heading.

The macro dialog now has a new option: Automatically refresh TOC when this page is edited.

TOC in Current Page dialog with the automatic refresh option

When you check it, the macro asks for your approval and then schedules itself for that page. From then on, it quietly checks the page in the background and updates the table of contents with the same settings you used when you created it.

The schedule is smart about how often it works:

So you get a table of contents that stays current while you write, without a macro hammering OneNote while the page is sitting untouched.

The automatic refresh option is not shown if the page already has a schedule.

Daily Planner Page: Tomorrow's Page Is Already There

The Daily Planner Page macro creates a page with a title, three monthly calendars, a task list, daily notes and a notes area. Now it can create those pages for you every day.

In the dialog, choose Insert for today, then check Automatically create daily planner page every day in this section.

Daily Planner Page dialog with the automatic creation options

You can then choose:

Today's page is created right away. After that, a new page is added to the end of your section every day by 6 AM, so it is waiting for you when you start your day. A few details that make it behave well:

See and Manage Everything in Options

All schedules, no matter which macro created them, are listed in the new Scheduled Macros tab in Onetastic options.

Scheduled Macros tab in Onetastic options

Pick a schedule from the drop-down to see:

Below that is the run history: a list of every run with its time, result, a message from the macro, and how long it took. If something does not look right, this is the first place to look. The tab updates on its own as schedules run, so you can leave it open and watch the history grow.

The Disable and Delete buttons let you stop a schedule at any time. Both ask for confirmation first.

What Happens While a Scheduled Macro Runs

Scheduled macros run in the background, so they are designed not to get in your way:

For Macro Developers

If you write your own macros, scheduling is available through a handful of new functions. A macro creates a schedule for itself with Schedule_Create, giving it a name, a start time, an end condition and a trigger such as daily, weekly, hourly or every N minutes. The work itself goes in a new function called BackgroundExecute, which is what OneNote runs at the scheduled time instead of Main.

Inside BackgroundExecute, the macro tells the scheduler how it went with BackgroundExecute_Success or BackgroundExecute_Fail, and that message shows up in the run history. A macro can also use Schedule_SetNextRun to say when it wants to run next. This is how TOC in Current Page backs off when nothing changes and speeds up again when you edit.

Copied!
function Main($arg, $context) // Run every day at 8:00 AM, starting now $created = Schedule_Create("Refresh TOC Daily", DateTime_Now(), \ EndCondition_Never(), Trigger_Daily(1, TimeOfDay(8, 0)), $scheduleId) function BackgroundExecute($scheduleId) // ... do the work ... BackgroundExecute_Success("TOC generated successfully")

The full details, with a complete example, are in the Scheduled Macro execution how-to.

What Else Could You Schedule?

Anything you do over and over is a candidate. Here are some ideas that scheduled macros make possible:

Tell Us What You Would Like to Schedule

TOC in Current Page and Daily Planner Page are just the first two. We would love to hear which other macros you would like to run on their own, or what repetitive chores in your notebooks you wish happened automatically.

If you have a specific workflow in mind, you can share it in the comments below, or send us a request on the Custom Macros page and we will take a look.

Also in This Update

New Batch File Import Features

Comments

Name
Comment

Other Posts

Show all posts