Time-based group activator

I have a set of macros that press images in certain bits of software that I cannot programme otherwise. as I have the mac automatically switching to dark mode, I have a duplicated group with versions of the images in the dark mode, and I switch groups as necessary. I'm really just being lazy, but I presume that there is a way to make KM do the switching on and off of the groups, but I can't figure out how to do it. can anyone help?

That's easy. I've solved this before. You don't actually need a second group of macros. You can solve this in a single macro. In the location where you press on the image, you just insert two actions, one that presses on the white image and one that presses on the dark image. For both actions, you have to turn off the error detection. One of them will work, and voila, the problem is solved.

1 Like

Are you sure?

I see where you are going with that question. If he tells you the application name you may have other methods to offer him, like the new Button action or the old AppleScript approach.

1 Like

as a relativist, and partial absolutist, I am never really sure about much

thank you. could you tell me how to turn off the error detection?

Notice that the two images below are very different, one is all black, from dark mode, the other is in light mode. Notice that if the first action fails to find anything, the result will be no clicking, and if it's not clicking, the second mouse action is undertaken.

Also, as I originally said, you have to turn off the error detection in the first action, like this:

That's where you turn off failure detection. I'm so sorry I wasn't correct right off the bat. After two or three inaccuracies today, I guess I need a break.

1 Like

this is very helpful, thank you for your kindness, and no need to apologise

KM can determine dark mode status, and combined with a switch action execute different actions depending on whether dark mode is enabled or not. See my example action below.

The advantage to this method as opposed to having KM try and click on both images and disabling the failure notifications is it keeps the Engine log cleaner as it doesn’t log failures since there are none.

EDIT: @Mr_D I just saw this is your first post, welcome!

Download Action(s): Switch-Case.kmactions (3.1 KB)

Action-Image

Keyboard Maestro Export

Action-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
  • The user must ensure the macro is enabled.
  • The user must also ensure the macro's parent macro-group is enabled.
System Information
  • macOS 13.6
  • Keyboard Maestro v11.0.1
2 Likes

Yes, your solution is better than mine. I would say sorry again, but Mr_D said I shouldn't apologize.

2 Likes

No need because both are valid solutions depending on what each person prefers doing. :wink:

1 Like