Keyboard Maestro Is Forgetting My Specified Applications

Hello,

I keep having this recurring problem where keyboard maestro is losing track of which applications I have specified in the macro.

For example, I have a simple macro where hitting Command-2 will bring a specific application to the front.

This works as expected - except sometimes it forgets which application I have specified, and brings up a different application instead.

When this problem happens, it seems to happen with every macro, and every command. The only solution I have found is to manually go through every macro and manually re-select the specified application. Since I have dozens of macros and hundreds of commands, this is extremely frustrating.

What's going on here?

Thanks!

More detail for those who want it:

I have a pretty significant macro workflow with dozens of macros with hundreds of commands, all specifying the specific applications to send the keystrokes to.

This system is amazing - it is an incredible boost to my productivity, and allows me to effectively work on 5 application instances simultaneously.

However, every now and then my entire system collapses when it forgets which applications to send the commands to, which requires me to spend hours manually re-selecting each application in every command for every application I want to send keystrokes too - pretty much an entire day lost. What's worse, is that when manually re-selecting all the applications, I can sometimes make a mistake, or miss one - which results in the keystrokes being sent to the wrong application. This can be both difficult to troubleshoot and also potentially dangerous as the wrong files are being operated on.

One item of note:

These are all the same application, Blender - an open source 3D rendering program. I have made copies of the application, and re-named them Blender 1, Blender 2, Blender 3, Blender 4, and Blender 5.

I use the interface of Blender 1 as my front application I am working with, and then send keystrokes to the other 4 copies in the background to render results and mirror certain changes I make in the front file to the other application instances.

I use this same process on my other workstations as well, with the only real difference between the macros being which applications are specified.

However, when this problem happens, it seems to forget other applications I have specific too - even ones that are not Blender, such as photoshop and safari. Its like the entire database of specified applications is being lost.

Is all the information about which applications to send the commands to stored within the macro itself, or is any of it specific to keyboard maestro preference files?

It also occurs to me as I am writing this that I am using the macro syncing feature to keep my macros synced across multiple computers. I have a unique macro group for each computer, which basically has copies of all my macros but with the changes specific to that computer (mostly just specifying which applications to send the commands to). Is it possible that something is going wrong with the synching process that is scrambling my macros?

In any case, this is very crazy making - the system works so well when it works and fails so catastrophically when it fails!

P.S. since I am currently going through the process of manually re-selecting the specific applications to send keystrokes too by manually selecting hundreds of drop-down menus across dozens of macros across multiple computers, any suggestions for how to make this process easier are also welcome.

Hey @chanpua,

I think it's very likely you've created your own problem due to multiple instances of the same app and syncing.

Firstly – try matching by path with your app instances:

Macro Group Definition:

image

Activate a Specific App:

image

Secondly – turn off syncing for a while and test.

It's not surprising that you'd have problems when syncing macros that have multiple instances of the same app.

If memory serves Keyboard Maestro defaults to using an app's path and resorts to using the Bundle-ID if the path fails.

Just in general – the macOS itself is not especially kind to multiple-app-instances – they don't have unique preferences and can step on each other under various circumstances.

Windows and macOS are very different in this regard...

@peternlewis – anything to add?

-Chris

4 Likes

@ccstone has covered it.

If you sync between Macs, the Applications referred to need to be in the same location (path and with the same name), as that is how Keyboard Maestro refers to applications by default.

If the application is not there, then Keyboard Maestro will look for the application using the bundle ID and the system will choose the application - usually the most recently installed, but not always. When that syncs back to the other Mac it is going to have the same problem.

As @ccstone mentioned, you can have Keyboard Maestro look for the application based only on the bundle ID, and that will work better if the application is running. But you cannot then reference different versions of the application which is generally desired if you have multiple versions of the same application.

Thanks for the replies. I am using match by path for specifying all my applications. I have disabled synching for now.

Looking at the raw XML of the macros and comparing them over the version history of my macro library this morning, the version I woke up to at 7:21am has all the correct applications specified. The next version at 7:38am has replaced every single application reference, for every single macro in my library, with the original instance of the application. It still shows the name as "Blender 2", but the path shown in the macro is now "Blender 1".

I have restored my library to the 7:21am version and everything is working again with the correct applications specified.

Synching seems like the only realistic culprit here that could have rewritten all 996 instances across 31 macros. This is, however, extremely odd behavior. My basic understanding of how keyboard maestro sync works is that it is just copy of the macro file - not a line-by-line interpretation of the macros. Changing the specified path globally across all macros seems like extremely odd behavior.

I have turned off synching for now, which is a bit of a hassle as I have to manually export and re-import the macros to 5 different computers, but if that solves the problem this is a much smaller hassle than re-selecting the target application across all the macros.

Synching seems like an easy scapegoat, but it syncs fairly often - whereas my problem only happens once every few weeks, which suggests that synching often does work. So far I have been unable to replicate the issue, despite synching multiple times from multiple computers.

It seems more likely to me that one of my machines updated the macros to the new (incorrect) paths, and those updated macros were successfully and correctly synced to the other devices.

I recognize that I'm pushing the envelope here on what MacOS and keyboard Maestro are designed to do - but welcome to the world of 3D rendering. Pushing everything to the max is what rendering is best at!

Perhaps we are dealing with an actual bug here? Rewriting the raw text of all macros in someone's library seems like undesirable behavior, even if my use case is unusual.

P.S. to be clear, I am using a different set of macros on each computer. The macro set that specifies the applications on computer 1 is a completely different macro group from the set that specified the applications on computer 2. I am not attempting to use one macro and expecting it to correctly specify the applications across multiple computers - each macro is customized to that computer and application.

As this task is fairly unique and depends on each computer having its own unique set of Macros, a robust solution would be to make a dedicated User Account on each computer that is just used for the Render Farm. Don't enable Macro Syncing for these accounts.

As syncing can be turned off and on for each User, you can leave the "normal" everyday accounts on these computers happily syncing their Macros without any chance your carefully set up Render Farm Macros will ever be overwritten.

Hey Guys

I have to ask you something that is burning my nails...

How can I avoid this or a similar Problem like @chanpua described if I have this Mac & Application constellation ?:

  • MacBook Pro 13" mid 2010 (High Sierra) + Script Debugger 7
  • iMac 2019 27" (Catalina) + Script Debugger 7 (AppName renamed from "Script Debugger" to "Script Debogger 7.0.13 ") & Script Debugger 8 (AppName still "Script Debugger")
  • sync is enabled useing Dropbox

My Case here:
I want to use only One Macro Group for Script Debugger 7 & 8 where the Macros work differently based on the App Version.

the same for BBEdit:

  • MacBook Pro + BBEdit 12
  • iMac + BBEdt 14

Would be great if someone could help me with this....
Maybe you Chris (@ccstone) ? or @Zabobon ?

Greetings from Germany

Tobias

Firstly, it is perfectly possible to have the Group work for different versions of an App if some computers have more up to date versions than others. And I do this all the time.

Click to show image

image

Depending on how you want the Macro's to work differently on each Mac you might be able to use a Switch Case based on each Mac's name. For example, I do this to get the same Macro to work with different screen sizes on my Macs.

Click to Show Approach 1

But it depends how many "differences" you want in the same Macro. In the end it might be simpler just to have two Macro's one for each Mac and use a Switch Case Action to trigger one or the other depending again on the Mac Name.

Click to Show Approach 2

1 Like

How Does that work in my Case ?

  • maybe (in case of BBEdit) I can install Version 12 & 14 on my iMac - but not on my MacBook Pro because BBEdit 12 is the last supported Version for a Mac with High Sierra (my MacBook Pro's latest usable OS)

  • the same for Script Debugger - Version 8 needs at least Mojave as the OS. This means that I can not Install it on my MacBook Pro like i can on my iMac.

Thanks for mentioning how I can use the Switch/Case Action for my Macros - this is not new to me - I use this approaach quite some time now. It can be helpful to others.

Greetings from Germany

Tobias

Hopefully I am understanding what you mean. The way it works is you set the Available in these applications: in the Group of Keyboard Maestro that is on each computer that actually has those Apps installed. The particular version doesn't have to be installed on all Macs.

So, on Computer A that has version 1 of an App you click the + sign and add in version 1 to the Group (as it will be there to be picked)

On Computer B that has version 2 of an App you click the + sign and add version 2 (as again it will be there to be picked).

Now both versions will be listed in the Group and the Macros will work in whichever version is on the Mac.

image

But if the differences between the two Versions of the Apps are so fundamental that many Actions will not work depending on the version, then I think your only options are to either have two alternative Macros depending on which Mac you are running on, or some form of Switch Case for Actions within the Macros.

EDIT: Switch Case can also be used to open different versions depending on the Computer Name.

1 Like

Yeah,

you got it ...

If I understand that correctly - KM will remember the linked Application (for Example BBEdir 12 from my MacBook Pro) in its Macro Group Settings even when I dont have BBEdit 12 installed on my iMac and BBEdit 14 not on my MacBook Pro - just because of the Fact that I have my Macros in sync between the two Macs?

If that is the Thing here I have learned something new today and will have to thank you for that Information - and of course @peternlewis for this great possibilities using Macro Syncing between multible Macs.

Thank you for reminding me on that - I'll cover that ....

Thanks for mentioning that, too ...
Even that is someting I could implement in my Workflow as for example a "Wildcard like Feature/Approach" depending what i am working on ... My brain is now spinning around... :joy: :joy: :joy: :joy:

Many Thanks

Greetings from Germany

Tobias

1 Like

Yes. That's it.

1 Like

Yes - if you have the application only on one Mac and nowhere on the other Mac, that should be fine.

However if you have the application in one location on one Mac and another location on the other Mac, the reference will change each time in syncs. But still, that will generally be ok.

But if you have multiple copies of the application on one Mac and different locations on the other Mac, that will not be good by default. Each time it syncs, Keyboard Maestro will look for the application at the specified location, and when it does not find it will choose one of the other versions. And that is what will sync back in the other direction.

First of all many thanks for your Work on this Application - I just love KM - and the more I learn on how I can use it - the more as deep I fall in Love.

Just needed to mention this - I think this could not be said too many times.

And thank you for answering on my post... I really appreciate that...

This is very good to know that you confirm on what @Zabobon has mentioned.

Wait ... I think I get this ...
Does this mean I can use only one Macro Group if for example the Application "PDFpen" (not -Pro!) is

  • on Mac A the Version that comes with Setapp ( installed at /Applications/Setapp/PDFpen.app ) ??
  • on Mac B the App Version which I would have to pay for from the Developer ( installed at /Applications/PDFpen.app) ??

Feel free correcting me if I am wrong....

Thanks for clarifying that - I doubt this won't be something I'll ever do on my Macs.

The only thing I'll do is giving my Script Debugger 7 installation on the MacBook Pro the same Name I did on my iMac and ensure the right Version is used in my Macros when working With Version 7 & 8 at the same time on my iMac - what I think is coemplex enough .... the same for BBEdit 12 & 14 ....

Greetings from Germany

Tobias

1 Like

No, you can have as many references to the application, that does not make any difference.

If you have, as you describe, the application in two different places on the two Macs, but nowhere else on the two Macs, then that will be fine using the default application reference (path first, then bundle ID). Every time you make a change on either Mac, the path will be wrong for the other Mac, but Keyboard Maestro will find it based on the bundle ID. So as long as the macOS Launch Services cache is working properly, that will not cause a problem (that is a bit of an if since the Launch Services cache is not always very reliable).

The problem happens when you have multiple versions of your applications on a single Mac, and they are in different places on different Macs.

The name being the same is insufficient. The Path must be identical on both Macs, if you have multiple instances of an application on one Mac and in different locations on the other Mac.

The name of the application is only significant in that it affects the Path of the application.

2 Likes

Thank you for clarifying this ....

I understand... It is only for my Purpose - It is better for me to have only one Reference to Script Debugger 7 in the Macro Group Settings instead of two.

My Plans are to get the details of the frontmost Running Version of Script Debugger at runntime of any Macro using the "set path to frontmost application as text" command via AppleScript.

Greetings from Germany

Tobias

1 Like

This solved my problem as well. I was going mad using the interactive help tool. It was insisting that the macro group was inactive and it turns out i had several Safaris listed in the application dropdown. I disabled syncing, quit everything, and restarted, and it seemed to have sorted itself. @peternlewis can this potential issue be noted on the Macro Group Inactive page?

Possibly, but it is noted in the Macro Syncing page which seems more relevant generally since it is a syncing issue.

NOTE: Keyboard Maestro references to files or applications that exist on one Mac and not the other will likely cause problems, so you should ensure any application you reference on one Mac is available at the same path on both Macs.

1 Like