Use a Prompt for User Input as a Notification

This is a very, very simple one - but something I've been using more and more...

With Keyboard Maestro notifications there are three standard options to Display Text:

image

I've used them all and they each have their advantages and drawbacks:

Display text in a window - I have to click to make the Window close and the Window appears in different parts of the screen to where I am focussed. Its big bonus is that the displayed text can be copied.

Display text briefly - is a standard in the top corner notification. Its bonus is that it goes after a few moments. But again, I am often not looking up in that corner especially if I have just entered something into a Keyboard Maestro Prompt Window. So, it doesn't work well to give instructions.

Display text large - this goes after a time but there is no control over how large the text is and it is huge.

So... I've started to mostly use the Prompt for User Input Action to act as a Notification. The advantages are that it appears wherever I last moved a Prompt window and that is most likely exactly where I would like the notification to appear. Also, I can set a timeout to whatever I want (3 seconds is usually fine) and it can be dismissed sooner by clicking its OK button.

To get it to work you need to set a couple of things in the Action gear menu:

image

Timeout Aborts Macro and Notify on Timeout must both be off (x) and you need to set the actual Timeout time:

Leave the title blank and you put whatever you want the notification to say in the Prompt Field.

And no need for the "Cancel Button".

Here is an example Macro to show how this all works in practice. The first Action is just a standard Prompt to ask for some data - it doesn't timeout.

The second Prompt (the one with the dotted red line around it in the image below) is the one that I've set up as a Notification and it goes after 3 seconds.

Use Prompt for User Input as Notification EXAMPLE.kmmacros (27.0 KB)

As I said, its an extremely simple idea but I haven't seen anyone else mentioning it and I stumbled upon it almost by accident.

5 Likes

Very nice. I haven't used it this way but I see the utility of doing so, The only drawback I can foresee is it would obviously delay any further actions in the macro until after it timed out. But if it's the last action in the macro then that wouldn't matter.

1 Like

Actually, there is another action that will probably solve your problem without setting up a prompt.

I use the Alert action.

3 Likes

If you want to not pause the Macro you can have it as a Sub Macro and call it Asynchronously. Again, it took me ages to work that one out.

1 Like

Great! I will play with this. What I like about the Prompt for User Input is that I can customise the buttons. I’m away from my computer at the moment but will try the Alert Action later.

Actually, I only put a Variable in my Example as an example of something to display. It doesn’t need a Variable to make it work.

But I am keen to see what the Alert Action does and if it has other advantages. So, thanks for pointing it out!

Very true!

Thanks @kcwhat So, I realise now that I had tried the Alert Action before but it has a few disadvantages for me. It appears in its own place on screen (whereas the User Prompt Notification that I have been using appears in the same position as any User Prompt used be the Macro and I like that). Also it gives no control over the buttons and I prefer the simple "OK" to dismiss the notification (or whatever other buttons I want).

And in terms of editing and improving my Macros, using User Prompts as notifications has another advantage - they can easily be adapted to actually ask for input or have more custom buttons if I decide at a later date the Macro could benefit from that.

So a simple Notification:

Can become more if needed:

And using @DanThomas's excellent KMFAM MACRO: [KMFAM] Favorite Actions and Macros v1.4 Released 2021-12-09 I can insert my customised User Prompt as a Notification with all the presets (timeout set, no cancelling of macro etc) in just one step.

1 Like

Whatever works for you @Zabobon. Just showing that there was another option. Enjoy!

Thanks - it's amazing how deep Keyboard Maestro goes - I keep finding new things!

I've been using this undocumented method for notifications for the last couple of months and as it isn't what this Action was designed to do, I hadn't seen anyone mention it. Hopefully the hint will help others discover this method too.

This is a very good idea and implementation @Zabobon :+1:

I had also long searched to me a hint to further KM actions to fade in. Especially for KM macros that I don't use daily.
I accidentally came across a BetterTouchTool AppleScript that shows me my desired notifications in the middle.

Here in the video an example for my Snagit Screenshot Workflow:

Video

However, the size of the text input for the notification is limited.
It can be set the display duration, as well as the animation for hiding.

It would be nice if KM would offer a week possibility of display.

2 Likes