The two shell scripts that effect the ark mode / light modes changes work; they were tested separately in Terminal as well as by manually running the Keyboard Maestro macro.
What I discovered was that the Appearance Changed trigger never fires when I switch Light/Dark in System Settings → Appearance. The macro and macro group are enabled and always active, and other triggers fire normally. Restarting the Engine made no difference.
Worth noting:
The Engine log shows the macro only ever running "from trigger Editor", never from the trigger.
To further test things, I also ran a small Swift listener for AppleInterfaceThemeChangedNotification via DistributedNotificationCenter, and it receives nothing when I switch appearance.
Is anyone else seeing this on macOS 27? Has the system's appearance-change notification changed?
Can someone who is running macOS27 please test the trigger on their machine to help me narrow down whether it is trigger problem (in which case I will ask @peternlewis for help) or whether it is local problem to my setup?
I dug into it noting the problem is solved; it was my setup, not macOS 27.
The cause was a palette setting in Keyboard Maestro: A macro in a palette-style group is never activated, so its triggers never fire, even though running it from the editor works fine. After changing that setting, the Appearance Changed trigger fires as expected on macOS 27.
To add to something in my original post: the Swift listener for AppleInterfaceThemeChangedNotification still receives nothing when I switch appearance. Since the trigger now works, Keyboard Maestro clearly doesn't rely on that notification, so please don't read my listener result as evidence of a macOS 27 problem with the trigger.
Follow-up, with a correction and two findings that may help others.
Correction to my original post. My Swift listener for AppleInterfaceThemeChangedNotification proves nothing: apparently that notification is only delivered to programs running as a full app, so a command-line listener never receives it. The Appearance Changed trigger was never broken; the cause was my macro group's palette setting ("Shows/hides a palette when:" only activates the macros while the palette is displayed).
Dictation causes a false Appearance Changed trigger (a macOS bug). On macOS 27, pressing F5 (Dictation) on a Magic Keyboard sometimes makes macOS send every running app a "System appearance change" about half a second later, even though the appearance does not change. The system log shows loginwindow, SystemUIServer, Control Center, Safari and Keyboard Maestro Engine all logging "System appearance change" at the same moment, with identical appearance values before and after. Keyboard Maestro is just reacting to it.
USB Device Key trigger blocks F5. Trying to filter this out, I added a USB Device Key trigger on F5 ("Joel's Magic Keyboard (USB) F5", Pressed). The trigger fires, but while it is enabled F5 no longer starts Dictation; disable the macro and Dictation works again. The wiki says the USB Device Key trigger leaves the key "not removed or affected in any way", so is this expected for the Dictation key?
This isn't entirely true. Generally, for a macro group that shows a palette, the macros will be active if and only if the palette is displayed (exception being the options that say "always activated").
I cannot explain this as the USB Device Key trigger only observes USB HID events and does not influence them, so the existence or non-existence of the trigger should make no difference. It seems more likely to me that if the trigger fires and actions perform, that those actions could impact the behaviour of the dictation.