Hello all. New to Keyboard Maestro and this group.
I have groups of Macros that I would like to Enable or Disable based on a specific USB device being present or not. I have searched the menus, and can only find the ACTIVATION option, but not the ENABLE/DISABLE option.
I have tried using the activation option, but as far as I can tell .. nothing happens
Can someone here enlighten a newbie so that I can start looking in the right direction?
Use the If Then Else action and the USB Device condition, check whether the device is attached or not, and then use the Set Macro Group Enable action to enable or disable the desired macro group dependent on the existence of the USB Device.
You can (and probably should) use the Activate/Deactivate Macro Group action instead of the Enable/Disable action. Enable/Disable is designed to be relatively permanent, and appears in the Keyboard Maestro editor whereas Activate/Deactivate is designed to be situation dependent.
A deactivated macro group will be functionally equivalent to a disabled macro group, and an activated macro group (assuming the macro group is enabled) will mean the triggers on the macros are available to be triggered.
The Engine Launch trigger is the one you see in the image below. The purpose of this trigger is to run a macro when the KM Engine starts. The KM Engine normally starts when you log in, but can also be started by yourself manually.
As @Airy eludes, the Engine Launch trigger will trigger the macro when the Keyboard Maestro engine launches, which will then allow the macro to set the state dependent on the existence of the USB Device.
This ensures that despite any connection or disconnection of the USB Device that happens while the Keyboard Maestro Engine is not running, the state of the macro group will match the existence of the USB Device as soon as the Keyboard Maestro Engine launches (after which it can watch for the USB Device being attached or detached).
Thaks a lot Airy and Peter. So ... this means that the ENGINE LAUNCH TRIGGER will execute at engine start, and that the ACTION field for the ENGINE LAUNCH TRIGGER will reference another macro? Do I understand is correctly ?
No … this will not work as intended if the macro you’re calling has the USB Device Trigger.
I give you the advice to get used to Peters Instructions he already gave you and build your Macro based on his description and combine it with the things that you want to happen.
If you’re still struggling after trying out - there is maybe someone else who can help you with the issue you might have then.