What am I missing? This works but is cumbersome to maintain (see Image 2). I would like to find a way to place the "Progress Bar Step" one time and have it update with the "Currently running SubMacro Name" in its title. Right now I'm using token: %ExecutingMacro% which is static once the Progress Bar starts.
What you have posted seems very complicated and I don't think you need to make it so complicated.
The new Progress Bar in KM10 is an Action that can be placed at a few key points in any Macro. There is no need to put it in a separate Macro. In fact, I think it is designed specifically to get rid to the need to call sub macros to make progress bars.
Its unique property is that every time it is called (from an Action) it closes its previous instance. Before the dedicated Progress Bar Action existed the only way to achieve this was to call another Macro.
So, the way I've been using it is:
Put a copy of it at the various stages in the Macro where you want to get progress. If you have four key points in the Macro, you could give them rough percentages like 10%, 50%, 75%, 99% and then 100% at the end of the Macro to close the Progress Bar.
That will work and give a graphical indication of progress
But a nice feature is that the % can be a Variable. So I have some Macros where I don't know ahead how many steps there are going to be and the Macro itself calculates the number of steps, divides that by 100 and feeds those values to the Progress Bar. All within the single Macro and no need to call a Sub Macro.
@Zabobon, thanks for the reply. Does your method provide feedback in the Progress Bar title of the current macro running? If I understand, I still need to add multiple instances of the action. Then why not use a customized subMacro? How does it calculate the number of steps? Do you add the variable in each instance of the PB action? How does that make things easier?
On certain macros I actually use a global DND_ variable to permanently track how many steps the macro has and use that to run the math, but that is a lot more involved to set up.
For most macros this method is sufficient and easy to set up as all you have to do is count how many actions you have (or a close approximation) and set that in a variable at the beginning of the macro. Then you duplicate the Show incremental progress bar actions group in between each of those actions.
This method will also show the name of the currently executing macro in the progress bar.
Let me know if you have any questions about it.
EDIT: Added a gif image to show how it works (obviously these are arbitrary numbers designed to show the result). I just added the show incremental progress bar actions group to a repeat action to give the effect of executing a long macro
Yes, the macros delete all non "DND" vars between each "locked order" in our case.
I find it curious that the prefix number is not deleted when called by %ExecutingMacro%. Not a big deal.
Question: If you have to set "pgStepPercent" between each bar update why not make the "Display Progress" and "Set Variable" actions a sub macro?
Another challenge I have is that there may be various numbers of actions/macros during a given "Progress Bar". If the pre-set "total" is not reached the bar does not disappear. In my solution I end with a different submacro that closes the bar regardless of the current percent.