Auto Shutdown Timer and Cancel

Hi, so I’ve built a macro that saves and quits all my applications and then restarts my computer. However, I’m having trouble with the trigger.

What I want to happen is for a dialog to pop up that says “do you want to restart” if you click cancel then it kills the macro, if you click yes it runs the macro. That’s the easy part. Here is the thing I can’t figure out. I also want a timer to be running simultaneously that if nothing happens for 10 minutes then it runs the macro.

So I’l have my mac activate this Macro at 3 in the morning. If I’m still working I can cancel it but if no one is at the computer then it counts down for 10 minutes and then runs.

Hoping someone out there can help with this. Thanks in advance!

You can try this Action:

with the following settings (using the Options gear menu)