Trouble getting Enable/Disable Macro/Macro Group action to work reliably after OS update

Hello Folks

Three days ago I decided to update my iMac 2020 Model from Monterey 12.3 to the last official Version (12.7.6 ??) and decided to stay with KM 10.2.

I don’t know what system of handling macros you others are using but I tend to have macros that give me access to others on demand - for example:

App „xx“ Launches

  • Enables Groups based on conditions which other apps are running
  • enables a basic set of Macros for this app I always need
  • if a Macro of the basic ones needs any other macro that it relies on it enables it on purpose- most of the time it disables it self after the work is done.

To be clear on how this is working - a group wirth setting = when Application x is running gets deactivated when I quit application x and so on …

Many many Enable/Disable Macro/Macro Group Actions to always make sure that I only have Macro Groups and Macros only available if I need them as a second layer based on KM‘s Group architecture.

I wanted to make sure you - whoever is replying - gets all basics on how my setup should work after a fix …

Now - after three days of working with my updated MacOS with many hours of getting or not getting hand on my macros that I need on a specific purpose and troubleshooting what causes the issue I realized that it is the Enable/Disable Action that doesn’t work reliably

What can I do ? - I know it’s a little bit confusing on how my setup works /should work but I have a single Macro Library with thousands of Macros for working with 2 to 4 Macs and all OS‘s from 10.13 up to 13.x and never had any issues so far on this setup …

There is no way for me to rebuild this all from scratch so please help

Greetings from Germany

Tobias

Ensure that your Keyboard Maestro preference folder and all of its contents have appropriate permissions and ownership. Sometimes migrations can mess up such things.

The Enable/Disable macro action is unusual in that it is about the old time that the Keyboard Maestro Engine can affect the macros (normally only the editor can make changes to the macros). Since the Keyboard Maestro Engine cannot write to the macros file itself, there is a separate Keyboard Maestro Enable Overrides file that contains the information about such changes. My guess would be that the Keyboard Maestro Engine either cannot create the file or cannot modify it which would speak to an ownership/permission problem, which may well have other consequences if it applies to the folder itself or other files in that folder.

Hey Peter (@peternlewis)

Thank you for helping me out with this issue.

Since I never had an issue like this since I bought Version 8 a few years ago and never had an issue like this wich any other Application I want to make sure I understand you correctly.

When you speak of owner permissions - do you mean that I have to check for my self as a owner ?! Am I right or am I missing something ?!

I’ve really read a lot about permissions in the past but I never had any type of issues they might come with them … so in this particular case I really need all information to get this fixed.

Greetings from Germany

Tobias

Yes.

In the Terminal, run the command:

ls -al ~/Library/Application\ Support/Keyboard\ Maestro

All the lines should have your Mac username and should start with either drwx or -rw-.

If you run the command

ls -ld ~

That is your home director, and should be the same - start with drwx and have your username.

For example:

drwxr-xr-x+ 200 peter  staff  6400 Jan 29 10:31 /Users/peter
^^^^            ^^^^^

Hello Peter :wave:

This is the output from my terminal for the check on Permissions for KM‘s Support Directory:


drwxr-xr-x   19 kurty_309  staff       608 18 Feb 08:34 .
drwx------+ 211 kurty_309  staff      6752 18 Feb 07:26 ..
-rw-r--r--@   1 kurty_309  staff     10244 20 Aug 10:26 .DS_Store
drwxr-xr-x@  58 kurty_309  staff      1856 20 Aug 10:27 Keyboard Maestro Actions
-rw-r--r--    1 kurty_309  staff     90112 15 Feb 22:22 Keyboard Maestro By Name Sort Order.sqlite
-rw-r--r--    1 kurty_309  staff   1748992 17 Feb 10:47 Keyboard Maestro Cached Compiled Scripts.sqlite
-rw-r--r--    1 kurty_309  staff      1906  7 Okt 17:28 Keyboard Maestro Clipboards.kmchunked
-rw-r--r--    1 kurty_309  staff     20480 27 Nov  2021 Keyboard Maestro Dictionaries.sqlite
-rw-r-----    1 kurty_309  staff        78 18 Feb 08:34 Keyboard Maestro Enable Overrides
-rw-r--r--    1 kurty_309  staff     14593 18 Feb 08:34 Keyboard Maestro Macro Stats.plist
-rw-r--r--    1 kurty_309  staff   7076135 31 Dez  2021 Keyboard Maestro Macros Saved Version 9.plist
-rw-r--r--    1 kurty_309  staff  14223442 18 Feb 08:34 Keyboard Maestro Macros.plist
-rw-r--r--    1 kurty_309  staff     21982 18 Feb 08:34 Keyboard Maestro Recent Applications.plist
-rw-r--r--    1 kurty_309  staff     65536 17 Feb 10:47 Keyboard Maestro Variables.sqlite
drwxr-xr-x   14 kurty_309  staff       448 18 Feb 08:34 Revisions Version 10
drwxr-xr-x   12 kurty_309  staff       384 31 Dez  2021 Revisions Version 9
drwxr-xr-x    4 kurty_309  staff       128 15 Feb 13:25 Running Engine Details
drwxr-xr-x@   5 kurty_309  staff       160 27 Nov  2021 Status Menu Icons
drwxr-xr-x    6 kurty_309  staff       192 16 Jul  2022 Tesseract Trained Data

and this is the output on my Home Folder

drwxr-x---@ 43 kurty_309  staff  1376 15 Feb 15:49 /Users/kurty_309

as you said

this line for the Keyboard Maestro Enable Overrides File

-rw-r-----    1 kurty_309  staff        78 18 Feb 08:34 Keyboard Maestro Enable Overrides

tells me that every thing looks absolutely ok, because I have Read and write access -rw- and it was changed at 08:34 - the time I closed the Keyboard Maestro editor just before I checked everything in the Terminal

for the case I could miss anything relevant I've included the full output of the terminal...

let me know if you think there might be an issue I cannot see...

Greetings from Germany

Tobias

Quit Keyboard Maestro and Keyboard Maestro and Keyboard Maestro Engine and trash the Keyboard Maestro Enable Overrides file.

The fact that that is not empty presumably means the editor is not running, since I believe it should be empty whenever the editor is running.

How do I have to understand this ?!

Does that eventually mean an empty file does not show up in the folder while the editor is running ?!

What can I do to avoid the opposite?!

Greetings from Germany

Tobias

  • Quit Keyboard Maestro and Keyboard Maestro Engine.
  • Remove the Keyboard Maestro Enable Overrides file.
  • Launch Keyboard Maestro (which will launch the Keyboard Maestro Engine).
  • Create a new macro
  • Add a Set Macro Enable action, and configure it to toggle the enable of the the new macro.

  • Click on the action, and click the Try button at the bottom of the editor window.

Does that work? Does the macro get disabled? If so, repeat clicking on the action and trying it, and verify that the macro gets toggled enable each time.

If that doesn't work, then something very odd is going on.

If that does work, then maybe there is some different issue going on, and you'll need to do some similar tests with two macros: One macro that has the Status Menu trigger so you can see whether it is active in the Keyboard Maestro status menu, and another macro that toggles the enable of the first macro (you can also give it a status menu trigger). Make sure they are both in the Global Macro Group.

Okay Peter - done

  • I've closed KM and quit KM Engine and deleted the Overrides File

  • then I left the Application Support folder open to see what's going on while following further your guide

  • created the very First Macro (in the Global Macro Group) with the Toggle Macro Action linked to this Macro leaving the Macro enabled

    • after Pressing the Try Button of the editor window a new Overrides File was created and the Macro was disabled

    • after pressing the Try Button again the Macro was enabled again but in the Folder the Overrides File still existed

  • I just duplicated the Macro and gave it a Status Manu Trigger and left it enabled checking that it shows up in the States Manu - every thing fine - it was true

  • I copied this Macro as Set Enable Macro Action and created the third one pasting the action in and set the Action option to toggle and repeated trying the toggle of the Second Macro to disappear and then reappear in the Status Menu - every thing worked fine, too

    • But there was still the overrides File in the Application Support folder unchanged
  • Then I went one thing further and closed KM and quit KM Engine again to delete this file again and restarted Keyboard Maestro

  • I selected the Toggle Action in Macro Three to repeated toggle the Second Macro (the one with the Status Menu Trigger) Disable and

    • A new overrides File was created
  • Again one step ahead and closing every thing again, deleting the file and reopen KM

  • Created a Status Menu Trigger for the Macro Three and triggered this Macro from the Status Menu to toggle enable on Macro Two because I left it disabled beforehand

    • A New Overrides File was created
  • I then created a Folder Trigger based Macro and repeated The the role test without leaving the Folder open and every thing was the same I was prompted for the exact amount of times and in the same context foe the appearance of the Overrides File and the File was kept in the folder unchanged.

I hope this gives you an idea of what maybe goes wrong.... If I am right and this File should only exist between the quit and the relaunch ok KM's Editor and or Keyboard Maestro Engine - then I am stumped here...

Greetings From Germany

Tobias

Yes, that is fine, the file should be created. When the editor is running, it should generally be empty, but still exist.

The question is, what behaviour of the Enable/Disable action was not working as expected in your tests?

Okay, thanks :pray:

I thought I’ve written down everything down but that seems to be not the case here …
I am sorry - I believe that my thoughts were somewhere else while I was making these tests

The behavior was as it should - every macro got enabled when it was disabled and disabled when enabled

Greetings from Germany

Tobias

OK, so ignoring the Overrides File, what issues remain?

Hmm :thinking:

I don’t really know … I tend to not using my setup until I am really sure that there are no issues remaining….

What I can do is stepping through my Background Macros and reenable them in the editor but this is a process that can take some time as well as integrate some logging to them which I then can try to compare to the engine log file.

What I definitely can say is that I haven’t found out about any other issues, yet.

Give me some days to get my setup back up - then I can tell you more.

Greetings from Germany

Tobias

OK, at this point, I think if it turns out you are still having issues enabling and disabling macros that the issue might be in your macros and your control logic, so that may be something you have to look at carefully (perhaps using the Log action to be explicit about what it going on).

Because of the issues I had I disabled the Action combinations that contain the Enable/Disable Action and replaced them temporarily with combinations that doesn’t contain them and enabled all macros and groups.

I’ve started to reenable my conditional working setup a few hours ago and including some logging using the Log Action. We‘ll see what happens when I am going to start using it all back up again. Will give you feedback on this.

Greetings from Germany

Tobias

1 Like

Hello Peter (@peternlewis):wave:

I’ve reenabled my setup like I want it to be for the most of my Macros and also added logging…

Everything works fine now … no more issues.

Trashing the Overrides File was the thing I had to do in this case.

Since this reply reflects that the issue was solved the most I‘ll mark this as the solution.

By the way - Is there any chance to create a macro that hits my attention if the Overrides File is not empty again ?!

I would like to create a macro that maybe takes a copy, Scans this copy and runs a separate application or script which then will quit KM Engine and the editor, trashing the Overrides File, and relaunches Keyboard Maestro and checks the newly created File whether it is empty or not.

Greetings from Germany

Tobias

I really would not bother. I've never heard of this happening before (and I'm not 100% convinced it was the cause anyway). Assuming it did happen, almost certainly the cause would be some sort of migration issue, not something that is likely to ever happen again.

What ever really caused the issue - I just have to thank you for your support on this.

Thank you :pray:

Because I want to avoid any other things to happen I decided to export all my Macros in the next days and also make a backup of everything else that is absolutely necessary needed and then I start putting back everything together starting with a fresh copy of Keyboard Maestro 10.2 until there is everything like it needs to be and then reenable KM Sync over Dropbox.

Since the SSD of my 13 inch MacBook Pro mid 2010 recently died after nearly 10 years I only have my 27 inch iMac 2020 which makes it less frustrating to build everything up from scratch.

Edit:
Please also note that I do this because it is the only Installation of KM 10.2 since the update to this version … I’ve always installed a os update without a clean install for more than two years…

Greetings from Germany

Tobias