MACRO: Execute (Trigger) Macro by Name (Spotlight)

Thanks! I worked really hard to get it right.

I still don't think the arrow keys work exactly as I'd like them to, but they're close. I also wish the highlighted item in the listbox stayed that color of blue even when the listbox isn't focused, but so far, that's escaped me. Something about Bootstrap is affecting that.

Also, I'm not 100% sure the search algorithm is exactly right, but I figured people could chime in if it doesn't work like they want. I mean, it works just fine, but whether it's perfect or not is up for debate.

Dan, I just got around to installing this macro, but I am confused.

All of the confusion is probably my doing.

Here is what I don't understand:

In your earlier Macro, MACRO: Macro Spotlight - DEPRECATED, it worked as I expected:
When I type:
@date
it found the macros that contain that string in the name.

But your new Execute Macro by Name does NOT:

Is there something I need to configure in "Execute Macro by Name" to make it include strings that start with "@"?

Thanks.

Should work just fine with “@”. Are you sure the macro is enabled/active?

Bingo! Made newbie error! :blush:

Your macro got installed in the "KM" group by default, which, of course, means it is NOT active with Finder frontmost.

Thanks for the very quick response to wake me up.

1 Like

This great macro works very well with the text tags searching technique.
See:
TIP: Searching for Macros to Run or Edit


BTW, I now have all of Dan's macros I have installed in my KM system tagged with the following:

Author.@DanThomas

This allows me to find all of his macros with a quick search using the KM Editor Search box.

1 Like

###New Version 1.2

Changes:

v1.2 - Now shows shortcut keys in the Status Line.

v1.1 - Removed options to save and restore editor scroll position, as KM 7.3 does this natively.

Dan,

Many thanks for this very quick update! :thumbsup:

Two minor glitches:
(nothing urgent)

  1. Extra character ("|") at end of hotkey

  2. Window does not appear on my active monitor, or near the active app. It always appear at the same location.

  • Can I change this to either be centered around the center of the frontmost window, or centered around the current mouse location?
  • If you can just point me to the macro/action/script that displays the window, I can made the mods.

What are the triggers for that macro?

Can I change this to either be centered around the center of the frontmost window, or centered around the current mouse location?

Actually, you can do this fairly easily. Just change the variable "DND__sspWindowPosition" to the "x, y" coordinates you want the window to display at, before executing the macro.

NOTE: While I was playing with this, the first few times the Spotlight window seemed to ignore the values in "DND__sspWindowPosition", then suddenly they started working. It's possible I have a bug somewhere.

So if this happens to you, mess around a little by opening the dialog and running something, until it starts working. I have no idea what's going on. :rolling_eyes:

Hotkey: I

OK, thanks. That's easy to do.

Fixed in version 1.2a, just uploaded.

Oh, and that issue where I thought it was ignoring "DND__sspWindowPosition"? It wasn't. I was executing the wrong macro. LOL.

Dan, this doesn't seem to be working.
When I do a KM full search for "DND__sspWindowPosition" it finds only the Action I have added to your macro with that variable.

When I look at the "Spotlight Search Prompt v1.0" macro, I don't see the window position being set anywhere.

It just hit me that maybe I have an old version of "Spotlight Search Prompt".
I'll go check now.

It’s referenced in the HTML file in the Spotlight Resources folder.

OK, I opened the HTML file and saw that.

But somehow it's not reading the KM variable correctly.

Here's where I made the change:

BTW, I have two monitors. Could that have an effect?
It is always displaying the window on monitor #2.

Then maybe you’re running into the same issue I did.

Without setting the variable, try dragging the window somewhere else and clicking OK or Cancel (NOT escape). Then check the value of the variable. Does it change? If so, then it’s the right variable.

It’s not an issue with multiple screens - I have multiple screens, and it works on my machine.

As I said previously, try it a bunch of times, dragging the window around, etc., and see if it suddenly starts working.

If that doesn’t work, let me know, and I’ll show you how to debug it.

It looks like you are storing the last window position in this KM variable:
DND__embnWindowPosition

It changes when I move the window and click OK.
DND__sspWindowPosition does NOT change.

When I set DND__embnWindowPosition it works:

Oh, cool. Shows what I know. :slight_smile:

You actually set the KM Variable name in "sspOptions":

1 Like

LOL. Thanks for the sleuthing. I totally forgot that!

Thanks for this one: you guys are just great. I just found it via 'Jim' from another topic.

1 Like