Clipboard Change Trigger Not Working

This macro used to work some time ago, but doesn’t work now. Did something change in KM to affect this? Did I turn off something in MacOS (Sierra) permissions that KM needs to run it? Both KM and KME are enabled in Accessibility.

Add Affiliate Codes to Clipboard URLs.kmmacros (10 KB)

Things change in Keyboard Maestro every version (otherwise what would be the point of a new version).

However, generally macros don’t break (except for very rare changes) unless they were fragile to begin with. Most fragility is caused by timing issues, but there can be other causes.

Other causes can include changes to the system, or occasionally system misbehaviour that is fixed by rebooting.

You’ll have to find out why your macro is not working in order to figure out the cause and how to correct it.

I was kind of hoping posting here might help reveal why the macro isn’t working. System clipboard functions work fine–I can copy and paste all day long. The engine log doesn’t show an entry for the above macro firing when I copy anything to the clipboard or anything it should find in one of the If statements. To me, it looks like KM’s not detecting the system clipboard change.

I just made a new macro that used a clipboard change trigger a few days ago in 8.0.5 on High Sierra 10.13.3 and it worked fine, so at least in my experience KM isn’t failing to detect clipboard changes.

After downloading your macro, I noticed that it’s in a macro group that is set to only be active when a status menu entry is clicked (as belied by how your screenshot says “Triggered by any of the following (when macro group is active):”). What happens when you change the group to always be activated?

What happens when you change the group to always be activated?

Same result, which is no result. I noticed that right after I uploaded the original macro.

Well, this is very strange. After a bit more experimentation, I got your macro to work, but the way I did so was by moving it to another macro group altogether. The two groups are both set to always be active in all apps and windows, so there's no reason that the one I moved it to should make the macro work while the original group didn't, but I can verify that, like you described, as long as I kept the macro in your original group it simply failed to execute even under circumstances when it should (and did, after being moved to the other group). Maybe exporting it from the group that worked for me will get it to work for you too?

Add Affiliate Codes to Clipboard URLs.kmmacros (10.7 KB)

The only change I made to the macro itself is to add a notification action at the top for testing, to make sure that it was being triggered without having to check the clipboard history switcher or paste.

I downloaded @iampariah’s original macro, installed it, enabled the macro group, deleted the actions and changed them to just a Notification action, activated the macro group, and now every time I copy something, the notification appears.

So it appears to be working ok for me, with Keyboard Maestro 8.0.x, and Sierra 10.12.x.

Thanks, Peter! I think that helped me to narrow down where the issue might be. Before I explicitly activated the macro group from the status menu with its old activation setting, an identically set-up macro would fail to execute no matter what. However, once I activated the group from the status menu and then changed it to “Always activated”, it began working as expected. From this, it looks to me like there may be a bug(?) that maintains a macro group’s original deactivated state from a prior activation setting if the macro group is changed to “Always activated” before having been activated using its prior activation option. In other words, it looks like a non-active macro group is not automatically activated even after changing its activation setting to “Always activated”. (hopefully that all made sense!)

It is possible - Keyboard Maestro remembers the activation state of macro groups across changes to the macro settings (otherwise every time you change a macro, all your activations would be set).

Since macro groups can be activated or deactivated programmatically, even when configured to the “Always activated”, it’s not really a bug per se for a macro group that was deactivated to remain so, but I’ll look in to it to see if there are cases where it should behave differently.

In any event, the Assistance window should explain whether the macro group is active or not.

1 Like

Hmm. As soon as I moved the macro out into a new group it started working. So something is wrong with that group, or the activation is bugged, like @gglick suggested.

Also, the other macros in the group also fail to activate by any means, including hot keys. It looks like this macro group is corrupted.

@peternlewis Let me know if you want me to send you the group or some other information.

Try setting the Macro Group to Always Activated, and then quit and relaunch the Keyboard Maestro Engine (in Keyboard Maestro’s File menu, Quit Engine, Launch Engine).

It’s working again after quitting and relaunching the engine. Odd that restarting the system wouldn’t accomplish the same thing. Thank you, Peter. I’ll keep an eye on it and let you know if the problem repeats.