Compare Defaults Macro (v11.0) - how to compare your macOS defaults when changing settings

I've created a macro that does something very interesting. It examines the contents of your macOS "defaults" data before and after you make a change to your system (such as toggling a button in your System Preferences application, but other changes using other apps can also be checked.) For example, you could start this macro, wait for it to tell you to make your change, then do something like toggle a macOS feature or a piece of hardware, then press OK, then wait ten seconds for it to tell you what has changed in the defaults app.

The main purpose to this macro is to find the "key" in your defaults app that is used to store the value of some system setting. Once you have that information, there are a few more steps you have to take (which I am not documenting in this post) to be able to write a macro in KM that will turn that key off and on. Modifying defaults is something that an average person probably should NOT do, because you can probably damage your OS. But reading the key is something that is safe to do.

This macro is safe, however. All it does is read your defaults and tell you what the "difference" is to that data before and after you make some change to your Mac.

Many people on this forum have asked how they can use KM to determine some "property" of their Mac. This macro will, in many cases, allow them to figure it out for themselves. There are further steps that need to be taken to either monitor or modify the value, and I have not documented that here. This macro simply helps you FIND the key, and does not tell you how to access or modify the key. That could come in a future update.

When you get your results it will appear in a window. If the window is empty or doesn't exist, there is no change to the defaults file, which means nothing you did changed the defaults data. Usually you will see a dozen lines (or more) indicating a dozen changes. It's up to you to figure out which lines are relevant to you. Sometimes it's obvious what's relevant, and sometimes it isn't. For example, I ran this utility before and after toggling the value "Allow Wallpaper Tinting" in the System Preference, and I got this result...

<         AppleReduceDesktopTinting = 1;
>         AppleReduceDesktopTinting = 0;
<             bottom = 618;
>             bottom = 635;
<         "NSWindow Frame KM_EngineAlert" = "928 822 537 160 0 0 2560 1415 ";
>         "NSWindow Frame KM_EngineAlert" = "928 805 537 177 0 0 2560 1415 ";

Now when I saw that result I noticed the first few lines and I said, "Hey, that means the setting in macOS which stores the value of the Allow Wallpaper Tinting is called AppleReduceDesktopTinting." I have no idea what the other lines mean, but that doesn't matter. I have found the name of the key and I can guess that "1" is one setting for that value and "0" is the other setting. From there, I can create a KM macro that either reads or controls that variable. This means that I can now access or modify a system property using Keyboard Maestro even if Keyboard Maestro doesn't have a built-in way to do it. I've seen many people ask questions on these forums that this utility can potentially answer.

Hmm, this macro doesn't have much documentation. It's not a well-written macro. If someone wants to improve it, go ahead. Consider it public domain.

_Compare Defaults Macro (v11.0)

_Compare Defaults.kmmacros (6.1 KB)