I have a macro I want to make that makes me take scheduled breaks for 3 minutes and forces me out of using my laptop or only let me use one app. Here is the macro I have made and have so far:
There is only one thing I don't know how I can do.
So this macro will be run scheduled every 2 hours. It will open an app and let me review things I've done and start a timer. I was thinking I could start a timer by creating a variable BreakTimeSeconds and setting it to number of seconds.
And then go into a while loop that will force me to not switch from Timing app until the timer is done. How can I decrement running down this timer efficiently? I am a bit confused by this.
I just tried this and it doesn’t work. It send hundreds of notifications and acts really weirdly if the whole thing is worked with the while loop after in the main macro.
Hmm. If what you want is to be forced to use only this Timing app for the three minutes that the timer is running, you don't need the "activate last application" action that runs if Timing is at the front. Try disabling these actions at the very end of the macro:
and then it should automatically bring Timing back to the front with the notification only if you try to switch away from it.
Only thing I am wondering though is whether calling a notification and this while loop together with a sub macro that computationally expensive? I think this is the best you can do but I am open to suggestions on how to improve it.
Glad you got it working! I have to admit, this is a very good idea for a macro
Regarding the computation expense, thanks to iStat Menus, I can tell you that running the two macros on my system makes KM’s process take up an average of 20%+ on one of my CPU cores, which doesn’t seem like nothing. However, a barebones macro that only pauses for 10 seconds makes KM’s process take up around 9% CPU, so considering the difference in complexity I’d say that a 20% average seems like a reasonable trade-off.