Progress bar/slider

I like the new Progress Bar Action.
But it is not in all my macros it is possible to calculate a percentage for the progress.

So a action in the same style as the Progress Bar could be a Progress Slider.

I imagine it could just af a start and stop action setting instead of a progress value.

Then it could set to start before a series of actions and set to stop after they have completed.

CleanShot-CleanShot 2021-11-16 at 14-45-44

Does anybody else think this could be a good addition to Keyboard Maestro?

2 Likes

Hey Jimmy,

I like the general idea, but I don't like the springy slider.

It's too similar to a normal progress bar and it's function ambiguous (in my opinion).

-Chris

1 Like

It already exists - built right into the System and is affectionately known as the Spinning Beach Ball of Death :rofl: :rofl: :rofl:
Spinning BeachBall

3 Likes

Hi Chris

I see what you mean. It could maybe then be a spinner of some sort.
I am open for ideas. And willing to make a design suggestion if @peternlewis wants it.
Or maybe there is something like it built into the system, which can be used.

1 Like

What you want is an indeterminate progress bar.

ss-209

In Mirror Mirror, I use this (which is subsequently closed by Window ID (you can see how it works in the macro's code).

ss-208

1 Like

Ahh. Yes. I thought it should be possible with the Custom HTML Prompt. Did not know how to close it afterwards.
Will look into it.
But a native solution would still be nice :slight_smile:

I made a solution I can use.
I have embed an image in the Custom HTML Prompt and it works fine with the function to close it at the end.

CleanShot-CleanShot 2021-11-16 at 21.08.56

Progress indicator Macro (v10.0)

Progress indicator.kmmacros (23 KB)

3 Likes

That is great! Actually very relaxing to look at.

1 Like

I'm not clear on how this is different to the existing Display Progress action intermittent indeterminate option?

2 Likes

Hi Peter

It isn't. I had not read the wiki for this action, so did not know that setting it to -1 would create this:
CleanShot-CleanShot 2021-11-17 at 08.47.49

So now I have two options. The Custom HTML one og the progress bar one.

Thanks for all the help to all.

3 Likes

Here is a macro using the native way to display a progress indicator.

Progress indicator NATIVE KM Macro (v10.0.1)

Progress indicator NATIVE KM.kmmacros (2.4 KB)

4 Likes

@peternlewis I followed the link but can't see anything about an intermittent option. What am I missing?

“If the value is less than 0, the progress will display an ==indeterminate== value.”

I think Peter misspoke (or misspelled as the case may be).

2 Likes

Hello! Im new to the forum and have been trying to adapt the multiple progress bars listed in this chat to different workflows. The thing that seems to throw me off is the placement of where the progress display should go in the order of the macro. I have been trying to test in on a simple repeat entry one, but I'm not having any luck.

Actually, you don't need to insert any Display Progress Bar action, because the Repeat action has a flag you can check off to automatically display a progress bar. Just click on the cogwheel in the Repeat action in your macro and you will see the option.

It is briefly mentioned in this page:

https://wiki.keyboardmaestro.com/action/Repeat

But if you really want to use the Display Progress Bar action, all you have to do is place it inside your Repeat loop. And then after your loop, you need to make the Display Progress Bar disappear.

You can also get a little more information here:

https://wiki.keyboardmaestro.com/action/Display_Progress

Thank you very much for this response!

To elaborate a little more, I've been tasked with creating a progress bar that not only shows how far along the macro has from completing, but if I put a prompt for user input action to repeat the macro a certain number of times, Id like to be able to show that progress. I was using this specific macro to try and understand how I could accomplish it. Below is the "goal" of what I'm trying to do:

EX:
████---------- "X%"
20 out of 100 complete

And this progress bar Id like to use on multiple macro cases, especially for one that will run for a while.

That's what both of my suggestions will do for you. Both of my suggestions will show the progress based on the actual value that you place in the Repeat action.

Your example seems to show something new (which you didn't mention in your first post), that you want it to actually report the percentage rather in addition to a progress bar. In that case you will have to implement my second suggestion.

As I said, just place the progress bar action inside the loop. And you will need to increment a variable from 1, going up by 1 for each time it loops, so you can calculate and display the actual percentage, using the formula: Counter/RepeatTimes*100 which you will display in the text box of the Display Progress Bar action. Perhaps like this:

Place that inside your loop. After your loop completes, add this action to make sure that the window disappears:

1 Like

There is only one KM-native Progress Bar -- every "Display Progress" from any executing macro updates that single dialog. Yes, you can have Duelling Macros, fighting over what the value should be :wink:

You put the action at any point(s) in your macro that you want progress to be updated (the Progress Bar will appear if it isn't already visible). It's often within a loop, but doesn't need to be.

It's not clear how you want the progress to be displayed -- you could do 0-100 for each of your "outer" repeats or you could do (0-100)/n x i, where n is "Repeat times" and i is the current repeat number.

Personally I think your "X%" is redundant -- that's what the bar is for! -- but I've included it in the demos to show extra calculation options.

First version, 0-100 for each "outer" loop:

Progress (Each).kmmacros (5.6 KB)

Image

Second, "summarised", version:

Progress (Summarised).kmmacros (6.4 KB)

Image

These are just to give you ideas -- there's many ways you can do this, many ways to calculate and display "progress", depending on how you want it done. I always like the bar to complete before it disappears, for example, so will show 99 then 100.

The "Display Progress" action is limited to a Title and a Bar -- you can do quite a lot with just those, but if you want more you'll need to look at using either a "Custom HTML Prompt" or an external utility such as swiftDialog.

1 Like

@Nige_S Thank you very much for these demos, the (Summarized) one is perfect. I am still fairly new to the software so I just had one more follow up on this. How do I take the summarized one that you created and adapt it to this current work flow that I have? Is it a simple copy paste? Or are there variables within this other workflow that need to be accounted for?

This is the current one, all I am trying to do is once I have entered the amount of times I want to repeat the actions, the summarize progress bar that you made, shows the progress of the number entered into that "Prompt for user input".

Thank you for your patience on this, still trying to fully understand:

You'll get a better response from the Forum if you upload your actual macro. See How to Post/Upload your Macros and Scripts for how to do that.

It's difficult, especially in a long macro like yours, to track what's going on from just an image.