Is it Possible for the Alert Action to NOT Take the Focus?

I need two options: stop or continue the macro.
For my use case, Ideally it should work as default alert notification of Mac. The notification is always at front and stays unless you act upon it but does not take the input focus when it appears. Wonderful if the alert action can appear exactly like the default alert of mac i.e. top right corner.

Or may be, can we convert notification action to have buttons: stop or continue macro?

You could try a Prompt for User Input action instead and leave everything blank. You'll just get two buttons; OK and Cancel.

'Prompt for user input' takes the focus.
I need something that does not take the focus.

I’ve no idea if this might be useful to you but you might want to take a look…

Yes I bumped into this post earlier.
I visited the github page for the tool. I got the impression that the tool is buggy.
I don't have technical background so I don't know how to use terminal or homebrew. And even though I end up setting things up for the tool, if the tool doesn't function properly, I don't know how to reverse the settings I made in terminal or homebrew.
So backed off.

My suggestion was in response to this, but it seems like you didn't really mean "or".

Nyet – it can't be done.

Apple doesn't have an API that allows developers to interact with notifications beyond creating them.

It might be possible to do this with KM's Custom HTML Prompt action, although I don't know what floating states are available. You'd have to up your technical knowledge game though.

1 Like

How about something like this? Triggering the Unfocused Corner Prompt macro will show a Prompt in the top-right corner and then return focus to the current application, using an asynchronous submacro:

Unfocused Corner Prompt.kmmacros (21 KB)

Macro screenshot

Focus Previous App (SUB-).kmmacros (19 KB)

Macro screenshot

1 Like

Dear Chris, do you have a special relationship to the Russian language?

If not, it seems to me that the English "no" is quite sufficient to make clear what you mean. Even though Tolstoy's language is certainly not responsible for what is unfortunately happening in the world at the moment, this usage is not funny. No offense intended. I hope you have a nice day in peace. :slightly_smiling_face:

Nor is it intended to be, and the fact that you seem to take umbrage is not my problem.

In my use case, I'd be running UI based macro and I might get notification for another macro, window of which would take focus.

And please don't mind for getting back late to your answer. I almost have ended up convincing myself to not seek for the answer and continue with what I'm already using. i.e. variable ON/OFF switch that would make another macro window pop up to wait if one macro is already running.
But I appreciate you taking time to write and share the macros.
Just curious, does the solution provided by you 'switch' the focus rather than not taking the focus at all?

Yes, that's right. The prompt takes focus for a moment and then switches it back.

1 Like

Could you use a Macro Palette to accomplish this? Make a macro group and palette with 2 macros, stop and continue, which set a variable that you can read from your main macro. show the palette when you want to prompt the user, and hide the palette after one of the macros is triggered.

2 Likes

Hey Evan,

There's a good thought.

@fluid_eye – see this example:

Is There a Way to Generate a Wait Indicator Until the Macro Finishes? - #8 by JMichaelTX

-Chris

1 Like

Bookmarked :+1:

I'm yet to learn what's macro palette. I'll check this idea out. Thanks for suggestion.

1 Like

KM-Wiki ⇢ Palettes user manual section