Action for a "Toast" notification? An alert with no Confirm

New-ish to KM (after using linux for decades) and enjoying it more every month. Hi!

I want a lil pop-up that just says something, but doesn't need to be confirmed, doesn't take the focus, and auto-dismisses. On some platforms these are called toasts.

I tried using Notification for this but it's not showing up. It's possible that my Mac is somehow weirdly configured in relation to notifications, as I often don't get notifications for other apps either, but they usually at least show up in the top right menu and I'm not seeing anything there either. Hm. The Notification action also isn't playing a sound when I have "Play sound" turned on for it. "Display Text" also doesn't seem to fire in any way I can discern. I made a point of turning my Focus Mode off in case that was interfering, and it didn't help.

Not sure if I'm looking for a custom Action plugin or what. Maybe I'm looking for a banner, which I need to trigger with AppleScript? Hm I just tried that display notification and in this case it DOES get buried in the notifications tray. Well, that would work if I could figure out how to debug that (which is outside the scope of KM). I'm interested in knowing if that's what others do.

Hmm... seems like these topics below are relevant (which I was only able to find by writing up this topic and having them show up) but they're old and seem to have a different emphasis so I'm still going to make mine so as not to spam old reply-ers. Also because some of the search criteria I was using (eg "toast" and "alert without confirm" didn't work).

Have you allowed Notifications from KM and KME? In System Settings:

Click into each, make sure Notifications are on, and set them as you wish.

See under: Set up a Focus on Mac – Apple Support (UK)

This code does something very similar using native KM features. Doing it this way gives you more control over the timeouts, and prevents it from being disabled when the user changes Focus. Also, I wrote it to remove the "toast" if the user moves the mouse over the message. (A cool feature.) It auto dismisses after 5 seconds, although I could make duration user-changeable if you like. You would call this macro by placing the text you want to display into the "With Parameter" field of your macro call. If you like this, I can modify it to better suit your needs. It was fun writing it.

Here's how you might call it:

Try this - it has an option so the focus only gets stolen for a brief moment.

1 Like