Disable Keyboard and Mouse during Macro execution


#1

Is there a way to disable user input when macros are running?

Sometimes I have these huge macros running and I end up forgetting they are still performing actions or a worst case scenario last week my wife’s cat decided sleeping on the keyboard of my macbook during a scheduled macro run.

I use alerts and notifications for reminding me when a macro is about to start or finish and use Pause Until Conditions Met using the IDLE function but it doesn’t prevent me messing something during execution.

I understand that by disabling user input I could no longer panic cancel a macro if something goes wrong.

Any ideas?

Thank you all in advance.


#2

How about just activating the Mac Screen Saver?
I just drag the mouse to the lower left corner to activate. Other options available.
You could probably do this in KM (just guessing)


#3

I use lots of UI actions and if the screen is screen saving or the display is asleep they won’t work.

Thank you for the reply.


#4

Wouldn’t disabling input cause the same problem?

Are you sure that the Screen Saver will stop you apps?
You might find this helpful:
Keep Background Apps Running When You Lock Or Put Your Mac To Sleep


#5

No.

Display a window (maybe use the Custom HTML Prompt?) that says not to touch anything, and keep it displayed (by putting it in a sub-macro and executing the macro asynchronously).


#6

While you are screen saving, screen locked, or screen sleeping, you cannot do UI. You can still run macros (as long as your Mac is not asleep) with non-UI triggers like the Time trigger, and the macros can still do lots of things, but not UI stuff like clicks and keystrokes.


#7

Thanks for the clarification about the Screen Saver, Peter. That is very helpful.


#8

Since Peter has confirmed that using the Screen Saver won’t work, how about this: turn off your KB.

I use a usb wireless KB that has on on/off switch. Turn it off and the cat can’t type. :grinning:


#9

according to https://apple.stackexchange.com/questions/67133/how-to-disable-the-built-in-macbook-keyboard
you can call shell script to do this:

disable
echo 'your admin password' | sudo -S kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext

reenable
echo 'your admin password' | sudo -S kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext