Scheduled Macros: Let Your Macros Work While You Don't
December 05, 2026

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.

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:
- It starts by checking every minute, so the TOC follows your edits closely while you are working on the page.
- If the page has not changed since the last check, it does nothing and waits longer the next time: 1 minute, then 2, 4, 8, and so on, up to about an hour.
- As soon as you edit the page again, it goes back to checking every minute.
- If the page can no longer be found, the run is reported as failed and the macro slows down to the longest wait.
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.

You can then choose:
- Repeat: every day of the week, or weekdays only (Monday to Friday).
- Stop After: never, at the end of the month, at the end of the year, or after a number of days you pick.
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:
- If a page with the same date already exists in the section, it is skipped, so you never get duplicates.
- Running the dialog again in the same section reuses the existing schedule instead of creating another one.
- Unchecking the option turns the schedule off.
- If you delete the section, the schedule turns itself off.
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.

Pick a schedule from the drop-down to see:
- Its name, when it was created, and which macro it belongs to.
- Whether it is enabled or disabled, and if it was disabled, why and when.
- How it repeats and when it ends.
- How many times it has run, and how many of those runs succeeded or failed.
- When it will run next.
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:
- They do not move you to a different page or section, and they do not show message boxes or file dialogs.
- If a run takes more than a few seconds, a small progress window appears in the corner of the screen. It does not take focus and you can keep typing, but it has a Cancel button if you would rather stop the run.
- Schedules only run while OneNote is open. If a run was due while OneNote was closed, it runs once when OneNote starts, and then the schedule goes back to its regular times.
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)
$created = Schedule_Create("Refresh TOC Daily", DateTime_Now(), \
EndCondition_Never(), Trigger_Daily(1, TimeOfDay(8, 0)), $scheduleId)
function BackgroundExecute($scheduleId)
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:
- Import files on a regular basis: bring in documents or exports from a folder on your computer or a network location, for example every night at 1 AM.
- Back up or export your notes: save pages or sections to files on a regular basis, so you always have a recent copy outside OneNote.
- Create a report at the end of every day: gather the day's tasks, meeting notes or changes into a summary page, ready for you in the morning or before you leave.
- Keep pages tidy: refresh generated content, sort pages, or clean up formatting as you work.
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
- A Markdown file's first-line
# Heading can now be used as the page title - Markdown task items (
[ ] and [x]) are now imported as OneNote To Do tags - Markdown list items are now indented correctly.
- Headings (h1-h6) imported from HTML, Markdown, Word and Outlook now get OneNote's heading styles
- Improved PDF printout quality
Comments