Which action creates a popup like the one that appears when you enable "Display when toggled" for a Macro Group? The Display Text action doesn't do this. It creates a notification on macOS, which is what I don't want. Here is an example below.

Which action creates a popup like the one that appears when you enable "Display when toggled" for a Macro Group? The Display Text action doesn't do this. It creates a notification on macOS, which is what I don't want. Here is an example below.

There is no action that displays a message like that, other than the one you mentioned. Are you trying to customize that message? What is your goal?
I'm trying different options to be notified when a macro has completed instead of using sounds. I hate notifications. Thanks for letting me know though!
Sounds are good. And I use spoken words even more. If you want a visual, though, you can consider "Display Text Large" to display "Quitting Macro" which works quite well and doesn't interfere with any windows' focus or keystroke input queues. Another possibility is toggling the display's dark mode, which is attention grabbing. Like this:
If you have Homebrew, I think there's a utility called terminal-notifier which is probably something you would like.
This macro by @DanThomas might be worth looking at:
The Display Text Large action is the closest to that display.

Alternatively, the Custom HTML Prompt action can be used to fully control the appearance of the display.
Yes, but it has the disadvantage of grabbing mouse and keyboard events.
Another other approach might be to use a macro group palette?
I've got a group "Billboard" where the macros—not the group—are disabled by default.
Then upon certain events I enable one or more of those macros and the palette appears. (Sometimes I even use AppleScript and dynamically modify the item's name)
Almost always—by design—selecting that palette entry disables the macro and dismisses the palette entry.
Because palettes always "float on top" for my personal use case the Billboard group is only active when the Finder is.
Actually, I use that trick for a couple of different use cases.
Another, related trick is to use the macro group itself and cause it to appear in the menu bar. (In my case, the current workspace of DEVONthink)
Keyboard Maestro is pretty terrific!
I like this, but I wish I could customize the size and how long it appears for. Thanks though!
I'll check these out. Thanks!
For the Display Text action, you can customize how long it appears, what colour it appears in, and to a small extent you can customize the size.
For the Custom HTML window action, you can definitely control all these things.
I also tried to find a notification style that wouldn’t grab focus from keyboard/mouse, and I ended up (with help from Madame GPT) with some Swift code snippets. Using Keyboard Maestro's "Execute Swift Script" action, I'm really happy with the basic idea -- less obtrusive than a typical "Notification" and they don't stack up when I have more than one. I'll definitely be iterating on these in the future. Like everything LLMs do, I'm sure it could be done more elegantly, but... beggars can't be choosers.
This one displays a magnifying glass in the middle of the screen:
import AppKit
// Config
let duration: TimeInterval = 1.0
let fadeDuration: TimeInterval = 1.0
let w: CGFloat = 140, h: CGFloat = 140
let app = NSApplication.shared
app.setActivationPolicy(.accessory)
// Centered on main screen
let screen = NSScreen.main!.frame
let rect = NSRect(x: screen.midX - w/2, y: screen.midY - h/2, width: w, height: h)
let panel = NSPanel(contentRect: rect,
styleMask: \[.nonactivatingPanel, .borderless\],
backing: .buffered, defer: false)
panel.isFloatingPanel = true
panel.level = .statusBar
panel.isOpaque = false
panel.backgroundColor = .clear
panel.hasShadow = true
panel.ignoresMouseEvents = true
panel.collectionBehavior = \[.canJoinAllSpaces, .transient\]
panel.isReleasedWhenClosed = false
// Rounded, dark background
let bg = NSView(frame: panel.contentView!.bounds)
bg.autoresizingMask = \[.width, .height\]
bg.wantsLayer = true
bg.layer?.backgroundColor = NSColor.darkGray.cgColor
bg.layer?.cornerRadius = 20
bg.layer?.masksToBounds = true
panel.contentView = bg
// Symbol image
if let image = NSImage(systemSymbolName: "doc.text.magnifyingglass",
accessibilityDescription: "OCR") {
let iv = NSImageView(image: image)
iv.imageScaling = .scaleProportionallyUpOrDown
iv.contentTintColor = .white
iv.translatesAutoresizingMaskIntoConstraints = false
bg.addSubview(iv)
// Scale to \~70% of bg size
NSLayoutConstraint.activate(\[
iv.centerXAnchor.constraint(equalTo: bg.centerXAnchor),
iv.centerYAnchor.constraint(equalTo: bg.centerYAnchor),
iv.widthAnchor.constraint(equalTo: bg.widthAnchor, multiplier: 0.7),
iv.heightAnchor.constraint(equalTo: bg.heightAnchor, multiplier: 0.7)
\])
}
// Fade in/out
panel.alphaValue = 0.0
panel.orderFrontRegardless()
NSAnimationContext.runAnimationGroup { ctx in
ctx.duration = fadeDuration
panel.animator().alphaValue = 1.0
}
Timer.scheduledTimer(withTimeInterval: duration, repeats: false) { \_ in
NSAnimationContext.runAnimationGroup({ ctx in
ctx.duration = fadeDuration
panel.animator().alphaValue = 0.0
}, completionHandler: {
panel.orderOut(nil)
NSApp.terminate(nil)
})
}
app.run()
This one puts a little save icon in the upper left corner of the screen:
import AppKit
// Config
let duration: TimeInterval = 5
let w: CGFloat = 60, h: CGFloat = 60 // make it more square for an icon
let app = NSApplication.shared
app.setActivationPolicy(.accessory)
let screen = NSScreen.main!.frame
let x = screen.minX + 20 // adjust position as needed
let y = screen.maxY - h - 20
let rect = NSRect(x: x, y: y, width: w, height: h)
let panel = NSPanel(contentRect: rect,
styleMask: [.nonactivatingPanel, .borderless],
backing: .buffered, defer: false)
panel.isFloatingPanel = true
panel.level = .statusBar
panel.isOpaque = false
panel.backgroundColor = .darkGray
panel.hasShadow = true
panel.ignoresMouseEvents = true
panel.collectionBehavior = [.canJoinAllSpaces, .transient]
panel.isReleasedWhenClosed = false
// Use SF Symbol as an NSImage
if let image = NSImage(systemSymbolName: "square.and.arrow.down.badge.clock", accessibilityDescription: "Save") {
let iv = NSImageView(image: image)
iv.frame = panel.contentView!.bounds
iv.imageScaling = .scaleProportionallyUpOrDown
iv.contentTintColor = .white // make the symbol white
panel.contentView!.addSubview(iv)
}
panel.orderFrontRegardless()
Timer.scheduledTimer(withTimeInterval: duration, repeats: false) { _ in
panel.orderOut(nil)
NSApp.terminate(nil)
}
app.run()
That one gave me a compile error. The other one didn’t give an error, but didn’t do anything. I’m guessing that the way you pasted it, some of your characters got modified by the website. I recommend that you paste your actions instead of a copy of the Swift code, to prevent errors.
Likewise, this didn’t work for me. But it looks interesting. As @Airy says, best way is to upload the actual Macro.
Whoops, sorry everybody. I thought I was being helpful by just giving text! Here's an example... two notifications in one macro.
Swift example macro.kmmacros (5.7 KB)
Those both worked, thanks. Yikes, that’s a lot of code for something simple.
I made a version to display a multi-line text message. Here is an example after I had ChatGPT make some improvements then give me a summary of the features.
This works for what I want to do at the moment but I figure the next step would be to convert this into KM subroutine with parameters to change the configuration. If someone wants to do this, go for it.
Purpose:
Displays a temporary floating popup in the center of the macOS screen with a custom text message (like “Keyboard Locked”), fading in and out smoothly.
Features:
Swift example - Keyboard Locked Macro (v11.0.4)
This is very nice. I wish we had more expertise in Swift here. But AI is helping me to accomplish new things in Swift that I’ve never been able to do before. This has opened up some new worlds to me.
OK, I've made some edits of my own:
So the result is that you can call this from another macro as a subroutine, defining whichever variables you want to get a notification with or without an icon (or just an icon, if you don't define a message).
I could imagine adding more to this, like defining where on the screen you want it displayed (corner options would be nice), but... I think I'm done for the moment.
I've never used Subroutines, so I'm sure I'm doing something wrong, but hopefully one of you smart people will clue me in. Hooray for Keyboard Maestro.
![]()
You inspired me to make a macro myself with the Swift action. I admit, most of the legwork was done by ChatGPT, but I achieved something very interesting. This macro does the calculations needed to make the text fit the window. So it works in the same manner as “Display Text Large” but it gives the user more control over the placement and size of the window. Here’s how you would call it to make it work like “Display Text Large”:
Display Text Large (Swift Implementation) Macro (v11.0.4)
Display Text Large (Swift Implementation).kmmacros (9.3 KB)
I have always loved the “Display Text Large” action in KM, but by implementing it myself using Swift, it gives me a lot more control and more possibilities.
Here’s how one would make it work like “Display Text Large”:
EDIT: something is wrong with the way I pasted the macro above. It didn’t upload the actual macro, just the screenshot. I’ll try to fix that.