Hot & loud computer

My 16'' MBP fan is almost always running and it hot to the touch. The activity monitor frequently has KBM as the top CPU and energy usage.

If I kill it and restart it seems to solve the issue. But it always comes back.

Any ideas why?

The next time this happens, try seeing what macros are running (you can do that from the KM status bar icon, under the Cancel menu) then take a look at them and see if there's an action or two (probably a loop or script or difficult to verify condition) that might be the culprit.

It might also be worth looking at the KM Engine log...

Generally, the only time you get high CPU usage out of Keyboard Maestro Engine is when it is searching the screen for an image (which is a highly computationally intensive task).

It will do this if you are executing a macro that requires this functionality (especially bad can be Pause Until since this will continuously check for the image). Check the Keyboard Maestro status Cancel submenu to see what macros are currently running, as well as the recently executed macros (select the All Macros group and sort the macros by macro execution).

If will also do this if there is an action editor displayed in the Keyboard Maestro editor which is live evaluating an expression involving searching the screen. Eg, an If Then Else action with a Screen Condition. Since the displayed "(currently true)" or "(currently false)" condition is updated every second, even if the macro is not executing, if the condition is displayed in the Keyboard Maestro editor, it is still testing the screen.

Cancel the appropriate macros, add timeouts if necessary so they dont recur, and don't leave the Keyboard Maestro editor displaying such an action (quit it, or undisclose the actions, or deselect the macro).

I had a suspicion that was it but this definitely confirms it. I do have a number of scripts that fire on keyboard shortcuts and have wait until image items. I guess I will have to remove those, unfortunately.

Just checked and I had a pause until script running. Canceling brought the CPU down.

Is there a way I can still use this but build in a kill switch? I have it only fire on keyboard shortcut but maybe there is a way to terminate the script if image not found after X seconds?

Click the gear icon in your Pause Until action and there you can set a timeout period. By default it is set to 99 hours! You can specify also whether to terminate the macro or not on timeout with or without a notification.