Interactive Scheduling of my day

I am trying to run an interactive plan for blocking Internet and distructions with the Focus app.
So far I have something like this:

The purpose of this macro is to time block in the morning. As soon as I opened my computer, it will ask me to block, click yes--> have 3 hours blocked for focused work (using the Focus application).

My problem is at the next step.

I want the second macro to run 30 after the time of the first macro ends. That is, I want it to run after 3 and half hours (after the first macro run).

Focus Macros.kmmacros (8.9 KB)

Here are the steps to run:

  1. Run macro 1
  2. wait for 3.5 hours
  3. Run macro 2
  4. pause for 30 minutes
  5. Run macro 2 again.

I don't have a lot of experience using time calculations in macros, so I could be way off base with this, but it looks like you could use a meta-macro of sorts controlling when each of your other macros are executed. Assuming my math isn't totally wrong, this seems like it should work:

Please note that if you go this route, you would also need to alter your second macro so that it no longer includes its own time calculation:

1 Like

Thank you, @gglick

I highly appriciate that you are helping me.

I am a bit scared of the “pause until” macro because I suspect that KM might be using the processor in all the time when the Macro is paused; at least that is the animation on the menu bar suggests so.

is that suspiction justified?

Other than that, I like your concept of Meta-macro that runs another macro. I am going to experiment with that one.

1 Like

Yes, I just checked with Activity Monitor. Paused Macros consume a lot of CPU.

It jumped from 1-2% to 11-12% usage as I paused the macro; and persisted so until I canceled the macro. When paused, KM is basically running the macro. It consumes a lot of CPU power.

Based on the Meta-Macro you suggested, I think I have a working macro now.

Focus Macros.kmmacros (8.2 KB)

1 Like

Looks like a very clever solution! I’m glad my idea proved useful, even if my particular suggestion didn’t match your needs. An additional 11-12% usage in my CPU wouldn’t bother me personally (perhaps because I primarily work on an iMac as opposed to a MacBook) but it is certainly better to do without it if you can, so it’s great that you were able to come up with something that accomplished the same goal without relying on a long Pause action (good use of the new cron trigger too; I still need to remember that that’s now an option in my own macros :slightly_smiling_face:)

1 Like

Well done, you basically came to the same result I would have recommended.

As noted, you could simply do “Pause 3.5*60*60 seconds”, but any macro running causes Keyboard Maestro Engine to use noticeable amounts of CPU, and is somewhat fragile in that if the Engine is relaunched for any reason that information is lost.

Much better is to set a variable for when you want the action to happen and just check it periodically, and every ten minutes is a good amount of time since it doesn’t really matter if it is 3.5 or 3.6 hours.

2 Likes

Thank you.

It is serving me the purpose. I am having pretty productive week based on this simple workflow.
The idea of having an interactive scheduling is based on Brian P. Morgan’s idea of “Performance Time”, in a book The 12 Week Year….

This is very helpful communty. Thank you so much.

1 Like