Change Color in Cultured Code Things

I like the new Dark Mode in Cultured Code's Things, but it was tricky to make a keyboard shortcut that switches from one mode to the other. Here's what I came up with.

Change Color.kmmacros (24 KB)

Hey Gabriel,

You can match either/or by using a regular expression in the menu item.

That makes it simple to toggle between the two.

-Chris


Change Color.kmmacros (22 KB)

The problem is that Things doesn't deactivate the Light menu item when in Light Mode, or vice versa. So your regular expression always matches "Light"—meaning it'll switch from Dark to Light Mode successfully but then has no effect in Light Mode.

Hey Gabriel,

Hmm...

Is there a check mark or some other means of indicating which is active?

-Chris

Yes, a check mark. I tried checking for that in the name of the menu item but it didn’t work.

image

Hey Gabriel,

You need to use an IF-Then with a Menu Condition to test for the checkmark.

-Chris

Yup, that's what I tried.

Hey Gabriel,

Well – something must be amiss at your end – because this works perfectly well for me.

(I do have to wait a second or so between toggles though.)

-Chris


Light-Dark Toggle.kmmacros (6.4 KB)

Oh, I didn’t know about the "is marked" condition! I was testing for the check mark character in the name of the menu item. That's helpful, thanks.

And yet, having compared the two, I'm going to stick with the pixel color test, because it works more reliably. (As you pointed out, there's a bit of latency before the "menu item is marked" condition works.) Still, happy to have learned something else about how KM works!