MACRO: Import Quick Macro v2.1 - Updated Jan 10, 2022 (It works now)

MACRO: Import Quick Macro v2.1

PURPOSE

Imports the current Quick Macro (if any) into the Global Macro Group, as a Macro named "Quick Macro - Imported".

NOTE: Requires Keyboard Maestro 10 or above.

Version 2.1 fixes a bunch of issues. This one should work. :crossed_fingers:

Version History
  • 2.1 - Rewrote some poorly-written code that should solve the strange issues that were happening.

  • 2.0.1 - Fixed a bug handling Global Macro Names that are blank (this happens when they have the "default" name).

  • 2.0 - Initial re-release

  • 1.* - Previous versions.

USAGE NOTES

Click to expand

Run the "Import Quick Macro" macro to import your Quick Macro.

It's possible that you could have more than one Quick Macro in the Quick Macros file. If so, that presents a problem, because there's no sure-fire way of determining which one is the right one.

So I've included a "Picker" macro so you can try to determine which Quick Macro is the correct one. Hopefully you'll only need to do this once, although I make no promises.

WHAT'S INCLUDED

Click to expand

After you import the .kmmacros file, you'll end up with three macros in the Global Macros group:

  1. Import Quick Macro
  2. Import Quick Macro Core (Sub-Macro)
  3. Import Quick Macro Picker

Use the first one to import your Quick Macros. It may ask you to run the third macro, the "Picker" macro. You won't run the second macro by yourself.

INSTALLATION

Upgrade Instructions

Delete the previous macro(s) before installing this version. Technically you don't need to delete the old version, but since it doesn't work, you might as well delete it.

Download the file and double-click it. The macros will import "disabled", so you'll need to enable them to use them.

Import Quick Macros.v2.1.kmmacros.zip (15.6 KB)

6 Likes

Dan, I'm sure this is great, but I have no idea what you are talking about.
Could you please add more details, and define "Quick Macro"?

Thanks.

https://wiki.keyboardmaestro.com/action/Record_Quick_Macro

This is great Dan, I just created a keyboard shortcut for it in Keyboard Maestro. There have been many times I would have loved to use this but did the longer method of creating a macro and then recording and running the “Quick Macro” but I don’t always want to run it to record it. Nice work!

What’s the logic for the added Semiphore lock at the start? Is that to keep the Quick Macro from getting hung up?

Thanks!

What's the logic for the added Semaphore lock at the start? Is that to keep the Quick Macro from getting hung up?

Honestly, I don't know. Your guess sounds reasonable to me. I actually didn't even notice it, because the quick macro I tested with had dozens of actions, so I just ignored all of them.

The semaphore just ensures that if the macro is triggered multiple times, it will play back multiple times in succession not overlapping.

So for example, say you record a quick macro "Hello There[return]" and then triggered the quick macro five times. Without the semaphore, you'd get something like "HHHHHeeeeellllllllllooooo…" (well, it would never be that neat, but you get the idea). The semaphore just ensures that the first triggered macro is completed before the second instance runs.

Thanks Peter.

To piggy back off that with the Key Repeat in the Quick Macro, after experimenting I noticed the speed of the retrigger go off the setting in System Preferences:Keyboard:Key Repeat. Maybe @JMichaelTX can add that to the documentation.
That may seem obvious but Keyboard Maestro could somehow have a hack (though I know thankfully you don’t do those) to set it’s own key repeat speed for the Quick Macro in preferences or set elsewhere. Plus it was completely clear what the check-box would do anyway. I know I am dense.

https://wiki.keyboardmaestro.com/action/Record_Quick_Macro

Yes, the repeat times for “while pressed” triggered macros including the quick macro is based on the system preference key repeat times.

That does not work for me, it allways imports the same macro, allthough I record different quick macros. Any suggestions?

No idea. It works for me, and I used it just recently.

Hey @DanThomas,

Happy New Year! Can you check to see if this still works for you? I'm having the same issue @John did. I even deleted and reinstalled it. I'm still on Big Sur with KM 10.0.2

It is NO rush.

Thanks for all you do!

KC

Last time I ran it, it didn't work for me either. I haven't really looked into it - too busy.

1 Like

Understood. Thanks!
HNY!

1 Like

I just checked it again on my system, and believe it or not, it works (although I didn't try it on Big Sur). Can you tell me what's happening when you try to run it?

For example, in TextEdit.

  1. I'll initiate the Quick Record.
  2. I'll type - Dan is great!
  3. Press Return
  4. I'll end the Quick Record Macro
  5. I'll run your Import Quick Macro
  6. The Import Quick Macro creates a Quick record macro, from several days ago, and not the Dan is great! Macro.

No matter how many Quick Record Macros I make, the creation of the new macro reverts to the older macro from several days ago.

John had the same issue. So somehow, something is holding on to a quick record from before.
I wish I knew were the save was so that I can clear it out and try again.

Take a look at this file:

~/Library/Application Support/Keyboard Maestro/Quick Macros.plist

Does the "Date Modified" look like it's right? If so, can you upload it so I can take a look?

@peternlewis I assume Quick Macros get recorded to the above file. Am I wrong?

The date is from today at 1:02 PM. That's about the time of my last test. I'll send you the link, to the file, via private message.

Edited: Dan, I even deleted that plist file that you referenced. KM recreates it and the import quick macro still reverts back to the older import macro and not the newest. But using the KM facilities, the latest quick macro works.

Record a short "quick macro" (just click on something).

Import and run this macro: Import Quick Macro Test.kmmacros (9.6 KB)

The results will show up in a window. Copy and save the text to a .txt file, zip it up (if you want), and drag the file into a PM to me.

OK, this is a shot in the dark, but let me know if this works. This macro will display "OK" in a window (unless I screwed something up), and hopefully it'll import the correct macro. Maybe. :crossed_fingers:

Import Quick Macro Test.kmmacros (8.7 KB)

I have to step out for a while, so I'll check back in when I get home.

The window does display OK but it still imports the older macro. Sorry I'm not reporting positive news. This shouldn't take your Sunday either... Enjoy your out time!

KC