MACRO: Go To Group by Name (Spotlight)

MACRO: Go To Group by Name (Spotlight)

NOTE: Do not double-click the package file "Spotlight Search Prompt Resources.pkg"

It won't hurt anything, but you'll get a very misleading error message. The error message will tell you that the file is corrupted. It's not corrupted. I shouldn't have used a package file to store resources. It doesn't hurt, but it's obviously confusing.

Please just move the package file somewhere, usually in your Documents folder or a subfolder. Then leave it as is. DO NOT DELETE IT.

It's clear that I made a poor decision to store resources in a package file. I'll work something out for future releases.


UPDATED v1.1: Focus is moved to the Macros group, after the Group is selected.

Go To Group by Name (Spotlight).v1.1.zip (870.1 KB)

See the enclosed README file for installation instructions.

By request. :slight_smile:

This is similar to MACRO: Go To Macro by Name (Spotlight), except this works with Groups instead of Macros.

Trigger this macro, type a few letters, hit Enter, and the KM Editor will move to the selected Group.

7 Likes

This is great. Thank you. The only thing I wish I could change is that I wish the focus will be on the contents of the group (the macros) so that I can :

  1. activate ‘go to group’ macro
  2. find group I want
  3. quickly look through various macros of the group with arrows

Hmm. So is that what you really want - to see the macros in a specific group?

Yeah, be able to see the macros and scroll through them and add a new macro with cmd + n to the group.

I was able to incorporate some of @ccstone’s great work (thanks, Chris!), and I just posted an update which I think will do what you want. I replaced the link at the top of the first message.

All you need to do is delete the current Go To Group by Name macro, then import the new one. Don’t bother with the Spotlight Search Prompt macro.

1 Like

Thank you, this is perfect.

I am curious, what is included in the pkg? Is it something that you can’t include in the macro itself?

I have a problem. Now every time I try to delete the .pkg, it asks me to locate the .pkg file even though I did it earlier. Do you know why that might happen? Didn’t have that issue before I believe.

You’re not supposed to delete the .pkg file. It contains required resources.

Oh I see, I will just move it then. Thank you.

You’re not the only one who was confused. Clearly, I need to re-think the idea of using package files for resources.

And here, I was so proud of myself for coming up with the idea! Sigh. :wink:

I’ll figure something else. Right now, I’ll post a note on all the macros.

Thanks for this info. Keep it coming. Remember, if you’re having issues, chances are someone else will also. Just because things make sense to me doesn’t mean they make sense to other people… In fact, they rarely do!

Hey Dan,

Perhaps.

Most people don’t know that they can right-click on a .pkg file and open it for inspection.

People may feel more comfortable with a km-resources folder.

-Chris

1 Like

@DanThomas I moved the Resources package, then clicked several of the installed macros, which asked me to locate the resources package. I located it and clicked OK...but the file dialogue simply pops back up asking to locate the package again, so I'm stuck in a loop until I hit cancel, but the macros don't work. They just ask me to locate the package file again. Love the idea of being able to go to a group quickly and look forward to getting it to work! :slight_smile:

If it keeps asking, that means that either it can't read the package, or there's something wrong with the package. Where did you put the package? What folder?

Thanks for your quick response. I tried the pkg file in multiple locations. The first was in a folder in Dropbox. I threw that copy away and unzipped the original zip file to get a fresh copy of the pkg file. I put that fresh copy in a folder named "Spotlight Search Prompt Resources" in the Documents folder. Then I tried putting the pkg file in the documents folder itself. Same result: keeps asking to locate the pkg file. That pkg file is called "Spotlight Search Prompt Resources.pkg". I got it from the zip file at the top of this thread: Go To Group by Name (Spotlight).v1.1.zip.

I'm using Sierra 10.12.3.

If you look in the Spotlight Search Prompt macro, two actions down from the top, you should see a group with the description "Verify and/or set DND__sspResourcesPackagePath". If I understand your issue correctly, this is where you get stuck.

Here's the reasons that set of actions would continue to loop:

  1. You're not selecting the package file.

  2. For some reason, it doesn't have rights to read the package file.

  3. Inside the package file, which you can view by right-clicking on it and selecting "View package contents", there should be a file named "Spotlight Search Prompt.html". If there isn't, then there's something wrong with the package file.

That's all I got. So look at the actions I mentioned, and see if you can figure out what's wrong.

Dan

Well...I think I figured it out. Occasionally, I get an odd addition in a variable that looks like this...

osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
/Volumes/.../Spotlight Search Prompt Resources/Spotlight Search Prompt Resources.pkg

The ellipsis is my edit for privacy. I have never been able to completely get rid of that osax file reference. I sometimes have to write a string filter into my script to remove that reference from a variable result before moving on in the script.

I removed the offending text from the variable and...walla.

P.S. So...I went to the scripting additions folder and removed the osax file. :thinking: Seems like I would've already done that before. Maybe it keeps reappearing. We will see.

Thanks for your help Dan @DanThomas

Wow, that's strange. Good sleuthing on your part, though! Glad you got it figured out!

Dan

You should be able to find the "/Library/ScriptingAdditions/Adobe Unit Types.osax file and remove it.

Very nice work! Extremely useful!

1 Like

@DanThomas
Hi Dan! After installing the newest KM V9.0 with macOS Mojave 10.14.6.
Running this Macro reports the following error:

System Events got an error: Can’t set window "Keyboard Maestro Editor" of application process "Keyboard Maestro" to true.

Num: -10006