How to check if clipboard changed after pressing cmd + c

I want to create an if statement where if by pressing cmd + c (copy) clipboard did not change, it does one thing, however if it did change, it will do another.

Thank you for any help.

This post by the inimitable @JMichaelTX should help you figure things out: [CB] How to Detect When Clipboard Has Changed [Example]

1 Like

Is it possible to somehow suppress the error sound that happens when you copy and nothing is selected?

You could use Toggle System Sound Mute before/after the copy command.

I was just testing this approach, and found that I had to put a small pause (0.2) BEFORE the Toggle Mute back on, else the sound was turned back on before the Notification, with sound, was shown.

###MACRO:   Copy Sound Mute

~~~ VER: 1.0    2017-08-23 ~~~

####DOWNLOAD:
Copy Sound Mute.kmmacros (2.6 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


@peternlewis, is this a bug, or just the nature of the macOS?

I would guess that "Mute" means set the volume to zero, and that the beep itself is still playing, you just can't hear it. So turning Mute off turns the volume back on and you can hear the beep playing.

You could probably do something like this:

Toggle Mute
Command:C
Toggle Mute
Toggle Mute
Toggle Mute
Toggle Mute
Toggle Mute
Toggle Mute
Toggle Mute

(and maybe a bunch more, maybe with short pauses between them) to get a clipped beep (b b b b b b b) which would confirm the meaning of "Mute".

Hmm, could be, but I don't think so. :wink:
As I'm sure you know, the Mac has separate controls (function keys) for mute, down vol, up vol.

When the KM Toggle Mute turns mute on, I can see briefly the same popup that I get when I press the mute function key:

Plus, when the KM Toggle Mute back on, the volume is just where it was before. :wink:

Something else, perhaps?

Sure, but it's setting the volume to zero and remembering the unmute location. So it's a different action, but the same result - the sounds are still playing, you just can't hear them.

You can hear the submarine beep toggling on and off.

Of course, you need 8.0 so you can play sounds asynchronously. And I used Engroup in Repeat to create the repeat action. But the principle remains unchanged.