I'd like to have a macro triggered when both of the following are true...
The system clipboard has changed.
The new system clipboard item contains a specific string. (For purposes of this post, let's say "xyz".)
Is there a way to do this?
I suppose one approach would be to use the "clipboard changed" trigger, and then have the first action somehow check if the current system clipboard item contains the string in question. It it does, then the macro can proceed. If it doesn't, then the macro would be cancelled.
Thanks! This makes a lot of sense. With that said, is there no way to do this where the macro doesn't get triggered at all if the new clipboard item doesn't contain the string? I guess there's just not a trigger that would accommodate for this?
A macro is either triggered or it isn't. I wouldn't worry about resource usage for something as simple as this, because if the If/Else condition isn't satisfied, then nothing beyond it will happen.
Additionally, you can restrict this macro by placing it in a group that is only available for specific applications, so that will cut down on the number of runs. This obviously depends on whether you want it to be available for a specific application or globally.
More generally, it's always a good idea to give broader context, in order to avoid an XY problem.
Depending on your ultimate aim, this may or may not be a good/efficient route towards it.
This reason probably sounds silly, but honestly, I just get distracted when the KM menu bar icon starts circling. So I just wanted to try to minimize that here. But if not possible, not the end of the world!
You won't find the Don't Rotate Status Menu action in the Keyboard Maestro actions list, as it's something Peter (the developer) posted to the forum. If you want to reuse it for other macros, save it as a favourite.
TIL the hard way that the "System Clipboard Changed" trigger is not invoked when com.stairways.keyboardmaestro.engine MaxClipboardHistory had been set to 0 to disable pasteboard history.
Leaving this here, in case someone else in the future struggles with that trigger.