Feature request for the Progress window

@peternlewis Could you please, pretty-please with sugar on top, add the ability to have the Progress window show a Cancel/Abort button? When the button is clicked, it would run a macro that the user provides.

I've wanted this for a while, but never asked for it before. But this time when I needed it, I wrote a Custom HTML Prompt to do the trick, which I launch asynchronously. The problem is, it takes a split second too long to open the window, which takes focus away from KM for too long, which means if the next action does something expecting the editor to have the focus, it will fail in unexpected ways.

Launching your progress window doesn't take focus from the editor, and it opens quickly, so this would eliminate the problem.

Thanks.

3 Likes

Noted. I'm not sure how I would do it though - it would need to allow you to specify the name of the button as well, since the meaning of the button would depend on the macro you triggered.

I'll ponder it.

2 Likes

Thanks.

I've actually managed to find a way to get my custom HTML prompt to work for me, but it's convoluted. If Custom HTML Prompts didn't grab focus, it would be just fine.

So I launch the prompt like this:

image

 
In the Custom HTML Prompt, I do this:

function KMDidShowWindow() {
	window.KeyboardMaestro.SetVariable("KMOR_ProgressWindowShown", "1");
}

So it works, but like I said, it's convoluted.

Could you just have a "Progress "Stop" button" option under the gear menu? Then if the user presses it during execution, the %ActionResult% token could output "Stopped" or something similar to be used as a condition moving forward?

Unless you want to get into all sorts of custom progress bar layouts, I think that would be a really nice addition.

1 Like

I don't think this would work, because the progress bar is launched asynchronously, so there'd be no place to inspect the %ActionResult%.

2 Likes

Oh yeah. :man_facepalming:t2:

Forgot about that.

1 Like

Don't feel too bad - I spent all day yesterday working on something, only to realize it would never work because of some face-plantingly obvious reason.

3 Likes

Well, I spoke too soon. My solution won't work, because the custom HTML prompt needs to be focused before you can click the "Cancel" button, which means the editor loses its focus, and everything breaks.

I have some other ideas I'll try.

1 Like