How to use keyboard maestro to remove the notification of specific application

I'm new to keyboard maestro but already become very interested in this powerful tool. Since I use Wechat a lot everyday, the notification displayed when other people texts me while I'm working can sometimes be really distracting, I'm wondering if there can be an easy way to turn the notification off with KM while using certain application on Mac?

Hey @renjieh2,

Does WeChat offer this ability?

Is WeChat AppleScriptable?

I suppose you could always turn on “Do Not Disturb” in the Notifications center.


As you can see in the image, I can manually set the alert mode, yet it still requires me to do clicking every time. I just want to simplify the process by KM, do you know how I can do that?

Following this thread I also wanna learn

Hey @renjieh2,

Here's a start.

Change “Alfred 3” in the script to “WeChat” and run the macro.

Open -- System Preferences -- Notifications.kmmacros (6.4 KB)

AppleScript UI-Scripting can be further leveraged to detect the alert style, OR you can use a Found Image condition.


I think I can now modify the notification using this script on KM after changing "Alfred 3" into "WeChat". However, I tried to add a hot-key as new trigger but it didn't work. Is it because that KM doesn't support using a hot-key as the trigger for the script?
In this image, I can pretty much use "try" or the play button on the top to disable the notification, however, the hot-key I defined doesn't work. Do you know how I can use to hot-key to simplify the whole process?

Hey @renjieh2,

Hmm – your keyboard shortcut works for me here on my system...

Make sure the macro group you have the macro in is GLOBAL and ENABLED.

If that isn't the issue then try “Assistance” in the Keyboard Maestro Editor Help menu.


I solved it, thanks a lot!:grinning:

1 Like