Display of progress of an Applescript that is within a KM macro

I have made a macro that includes an AppleScript. This script takes a number of seconds and I want to inform the user of the progress. A progress bar.

There is a display progress function within AppleScript but that only works when the script is run from an applet.

There is the keyboard Maestro action "Display Progress" but that cannot be included in the loop within my AppleScript.

Does anyone know a trick how to achieve what I would like to do?

The way I might approach this is to use a secondary macro that displays the progress of all your AppleScript loops, like so:

AppleScript (Progress Bar).kmmacros (20 KB)

Macro screenshot

AppleScript (Progress Bar) - Display Progress (SUB-).kmmacros (38 KB)

Macro screenshot

This is a simple example that increments progress by 10% every second, but you can adapt it to include whatever other actions you require.

Let me know how you get on.

2 Likes

Thanks. That is a possible workaround indeed. I was hoping for something less confusing as the macro I make is itself already a macro that will be nested. But, it will work I would guess, thanks!

What is your macro designed to do?

Getting data from Pro Tools. And processes it.
Pro Tools is a professional audio editing mixing program but it reacts very slow on AS.
But actually the part that takes so long is not a loop inside the AS so it will feel like stalled for a few seconds anyway. But the repeat that comes after that can at least be monitored.

I'm a Logic user, but out of pure curiosity, what kind of data are you grabbing?

All the data from the Memory Locations Window

In case this is of any help, it appears that you can export session data from PT directly without using AS:

Yes, true. And I know this. There are certain issues that I have with this why I cannot use it.
But thanks.