Is There a Way to Generate a Wait Indicator Until the Macro Finishes?

I have a macro that has a ~3 second runtime. Since it involves window resizing and moving between different spaces, I don't want to interfere with it while it's running. Is there a way to put a indicator on the screen such as a spinning wheel? Technically "Notification" will do the job but I found it a bit redundant for this purpose. I know this isn't really macro-related but I'd really appreciate if someone can point out the right direction. Thanks.

simple way:

Add a couple notifications while your macro is working:

image

I have a macro called "Wait" triggered as a global palette. I enable the macro at the start of a long-running macro and disable it at the end. I use a Stop Sign icon for Wait, and so it displays

image

The body of the macro could be empty, but I throw in a Cancel All Macros action just in case.

I was asking for a similar thing here.

@appleianer recommended AnyBar to me:

You need to get some png files to make it show up in the menu bar.

Later, I found this post about BitBar:

BitBar is now replaced by xbar.

xbar does not need png files. We can make emoji characters (or any text) to show up in the menu bar.

You can certainly integrate this in your macro.

  1. show the icon (AnyBar) or emoji character (xbar)
  2. run execute the other actions you made
  3. after the actions are done, quit AnyBar/xbar.

Example for AnyBar (this requires that I have a png file named horse.png in the AnyBar folder [see instructions on the AnyBar github page]):
image

Example for xbar:
image
This requires that we have an applescript file named "kmstatus.1d.applescript" stored in the xbar folder. This is the AppleScript:

#!/usr/bin/osascript

####################################################
##### get all variables that begins with "xbar__"
#### this exmaple is made by user 'iNik' on KM forum.
####################################################
--set AppleScript's text item delimiters to {" "}
--tell application "Keyboard Maestro Engine" to get (value of variables whose name begins with "xbar__") as text
####################################################

#### I made this just to get the value of one variable.
tell application "Keyboard Maestro Engine" to get (value of variables whose name is "xbar Icon") as text

I found xbar more flexible. It's primarily designed for other functions. It has many plugins to show all kinds of things in the menu bar. But in our case, we only need to show an emoji or something in the menu bar to remind us a certain macro is running or a macro is enabled/disabled or whatever you want. Even just for this purpose, xbar allows us to show as much text as we want.

By changing the variable value:
image

We can easily get
image
in the menu bar.

Hey Mike,

Here's how to do it with Display Large Text.

-Chris


This looks great!

Would you mind uploading your macro?

The macro really doesn't do anything. The macro is normally disabled and therefore its name ("Wait") and icon aren't displayed. When the macro is enabled, the name and icon appear in the global palette. With a busy or small-text global palette, this might not be effective, but my global palette is generally empty, and I configure that palette to have large text. Alternatively, you could put the macro in a separate palette of its own.

Thanks. While waiting for you to post, your idea inspired me and I came up with this variation on your concept.

Example Output

Demo-Wait-Indicator-Palette-AN

Macro Group Setup

image

Of course you can customize the Palette color, size, icon, and text.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Wait

-~~~ VER: 1.0    2021-03-11 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Wait.kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.

Uploading this Macro will create the Macro Group "Wait Palette".


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Macro To Test Wait Palette

MACRO:   Demo Use of WAIT Indicator [Example]

-~~~ VER: 1.0    2021-03-11 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Demo Use of WAIT Indicator [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


The above version has an empty (no Actions) Macro.
Add this Action to close the Palette manually at any like, like if you cancel your Macro.

image

Download Hide Macro Group "Wait Palette" Action

Macro Group Toggle.kmactions (495 B)

Be sure to click in/select the empty "no actions" area in the "Wait" Macro before you import this file.

4 Likes