MACRO: App Launcher

A few months back, @Peter posted a simple app launcher, which worked well. I saw it and thought "I wonder if I can maybe improve it just a bit, i.e. let me easily add other folders where I store apps."

My first take on it was just Peter's macro with a new method of finding apps, and a setting to let me add more folders without mucking with the shell script. But as is typical of my projects, one thing turned into another, and the complexity grew—especially when I saw @BernSh's addition to the topic (they created a visual switcher with app icons). I liked the visuals, but love using the keyboard, so I wanted the best of both worlds.

So again, the complexity grew, and finally, we have what I'm simply calling App Launcher…

— App Launcher Macros (v11.0.4)
— App Launcher Macros.kmmacros (66 KB)

This is your standard app launcher, in that it presents a list of all apps it can find, in both the usual /Applications folder and any others you specify. It can, however, take on various appearances…

Other appearance options…



...and includes the option of fuzzy searching, which lets you do things like this:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Note/Disclaimer: Claude was heavily involved in two aspects of this macro: The Swift code that gets the list of apps and converts their associated icons, and the JavaScript that makes the launcher box interactive and adds all the cool features.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Other features:

  • Add as many app search paths as you wish.
  • Exclude apps from the launcher by name and/or regex (i.e. Safa.*), no path needed.
  • Show or hide the path display.
  • Show or hide app icons.
  • Choose light, dark, or auto (match Mac) theme.
  • Enable or disable fuzzy searching.
  • Set the launcher's window height and width.
  • The list is built with Spotlight, as that's the fastest method. You can disable Spotlight support, though, and the only downside is that the occasional rebuilds will be somewhat slower.
  • App list rebuilds automatically on an interval you can set, or you can do it manually by invoking with ⌃⌘⌥Space instead of the usual ⌃⌘Space. (You can change the shortcuts, of course, but if you want the manual rebuild available, either include the Option key in one of your triggers, or change the logic that checks for the Option key down to invoke the rebuild.)

The first time you run the macro, it will be somewhat slower than normal, as it has to both compile the Swift script it uses, and then find and save all the app-related data. The data is all saved in one global variable, rg_LaunchApps. When you rebuild the app list, only the list is rebuilt—there's no need to recompile the script.

The fastest mode is when configured as shipped, with icons disabled. In that mode, getting a list of 360 apps on my Mac takes 0.20 seconds on the first run; subsequent runs take only .03 seconds or so.

With icons enabled at 16px, those number increased only slightly on my Mac—0.28 seconds to build, and 0.035 seconds to display. Set to 32px, the values were 0.45 seconds and 0.04 seconds. Here's an example of the speed with icons disabled:

An animated GIF hides within…

launcher

NOTE: Using 32px icons is not advised; on my Mac, it results in a variable that's 2.7MB, large enough that I once saw it excluded from the environment. But using 16px, it's only a 1MB variable, and they look acceptable.

The macro should run as-is out of the box, but please read the Read Me First macro to learn about customizing the various settings. As of now, I haven't included my "check for updated versions of this macro" routines, but if this proves popular, I will. For now, just always check this first post for any newer versions of the macro.

Let me know if you have any questions.

-rob.

4 Likes

And it's back—sorry about that! I noticed that I had left a reference to a subroutine in another version of the macro, so this one didn't work. I also modified the macro to automatically compile the Swift script, and to make the use of Spotlight optional.

-rob.

Did you get it working? I saw you posted something, but now it's gone.

-rob.

No, I didn’t get it working. I think it goes through the initial compilation step OK, but then it just hangs at the “Building the list of apps” progress bar. As another data point, the status menu doesn’t show this macro on the Cancel list even though the progress bar is still “running”. I deleted the macro set and reinstalled from the forum download today just in case something had changed, but no bueno.

These are the macros in the group, though I’d swear there was one more when I downloaded this the other day:

Thanks.

Rob O

That's the old version of the macro, and it has a known issue. Please download the new version (linked in the first post).

-rob.

Did that. Deleted the old compiled script and started over. The script is there; the rg_launchapps variable is there and seems to be populated correctly, but when I run the macro (either via hotkey or by manually running it from the editor), I never see the prompt. The macro is running because I can see it in the Cancel menu. I’ve even closed every other window on my Mac, to be sure the prompt window isn’t hiding somewhere

Send me a DM, please, and we'll get this figured out.

thanks;
-rob.

We managed to track @rolian's problem down to a beta version of macOS 26.6. Long story short, if you're using beta 2, update to beta 3 before you try this macro :).

-rob.

Will this macro get confused if I am syncing my KM macros and the two machines have different apps installed?

PS: I use your Web Search via Shortcuts many times a day, so am looking forward to trying this out.

No, it gathers a list of apps on each Mac, and stores it in a global variable. But as variables aren't synced, there won't be any confusion.

-rob.