Idea: Pause KM Engine Action & Menu Bar Option

You really only need one AppleScript: One that toggles the KM Engine on/off.

@JMichaelTX @ccstone Thanks for the script above for toggling the engine quit and launch that helped me a lot.

The way I see the difference between Pause/Resume and Quit/Launch:

  1. Pause/Resume: simply stop receiving any new triggers, and no macros firing after resume.
  2. Quit/Launch: macros will be fired if linked to "engine launch trigger", which may be heavily burdened and time-consuming even annoyingly window focus taken away.

So a pause/resume would probably be a better option if it can be implemented as I can see it.

Possible scenario:

  • While F12 is down as an engine suppressor, KM engine stop receiving any trigger, do whatever we need to do, no worrying about engine lagging, focus being taken, etc;
  • While F12 is up, KM engine starts to receiving triggers again.

Walter

Hey @Walter,

Keyboard Maestro does not have this capability.

The engine is running or it's not running. There is no pause.

For your scenario to work the Engine would have to be running – otherwise how could it tell whether a key was up or down.

You might be able to suspend the process, but I'm not sure that'd be a good idea.

@peternlewis?

In any case you'd have to have something outside of Keyboard Maestro like FastScripts to run the pause/continue script.

-Chris

Any Engine Launch triggered macros are easily dealt with since you control their behaviour.

There is no “Pause Engine” because what it means would be different to different people.

  • Should the application/window switcher keep working?
  • Should the clipboard history keep recording?
  • Should the list of running applications and their orders keep updating?
  • Should the web server keep running?
  • Should the web server keep accepting remote clipboards?
  • If the Engine is paused, how can you reactivate it?
  • Should just UI triggers be paused? What about remote or timed or application change triggers?
  • Should the status menu still work?

etc.

If you want specific macro groups to be inactive, inactivate them using the existing methods.

If you really want to stop the engine, then quit the Keyboard Maestro Engine, and launch it by some other means, and accept that all of its facilities will be missing.

1 Like

Arrrrr...Yes! Stupid me. Maybe it's gonna work for the "key down" and then the "key up" will not work.

You are right. There are way more considerations behind it than I thought, and thanks for pointing it out. I'm gonna do some work to clean out the Engine Launch trigger a little bit.

2 Likes

I have been using "quit" and "launch" the KME pretty often recently. I remembered this post and came to see if the "pause" function can be implemented.

For me, personally, if the "pause" is implemented, it's totally fine to pause everything, except perhaps allowing a keyboard shortcut to toggle between "pause" and "resume" the KME. It is almost like "quit" and "launch", but it will take less time to "pause" and "resume" than "quit" and "launch".

Or better, you may offer a setting to allow users to choose whether the clipboard history keeps recording or not, etc.

Hey Martin,

Peter has pretty unequivocally said no to the this one.

This is doable now.

manual:Preferences [Keyboard Maestro Wiki]

Set the MaxClipboardHistory to 1 – NOT 0.

If you set it to 0 some clipboard functions in Keyboard Maestro will cease to function.

-Chris

Which ones? Keyboard Maestro should read the system clipboard directly if it needs to.

The primary difference between 0 and 1 is that 1 will still have Keyboard Maestro read every clipboard when the system clipboard is changed, which can produce bugs in some badly behaved applications, whereas 0 will not read it at all unless you explicitly reference the system clipboard.

Thanks, Chris. I'm aware of that. My comment was specifically related to the "Pause" KME setting. It is intended to be temporary (while the KME is paused). If "pause" is not going to be implemented, I will have to "quit" KME when I want to "pause" it. All other settings are then meaningless.

1 Like