Hide and Show Widgets on Desktop in Sonoma

Here are two macros to hide and show widgets on the desktop in macOS Sonoma.

Widgets in Sonoma.kmlibrary (5.4 KB)

2 Likes

Wow, thank you @ikenassi, I appreciate your willingness to share your hard work (and everyone else who provides support). I will never give up trying to learn this stuff, but I have not been very successful over the years with my automation scripting. I know I need to put more time into it though, and I appreciate this forums knowledge sharing. I hope to pay it forward some day, thank you!

I am on the forum today, trying to see if anyone has a macro or any discussion open about Sonoma Widge Styles (System Preferences > Desktop & Dock > Widgets). I am trying to figure out if I can use a shortcut or macro for quickly changing the Style from Monochrome to Full-color. I like using Full-color, but it can also be distracting at times.

Thanks again and happy holdiays, all!

JFree

Your comments are extremely welcome. Here is a slightly more robust version:
Widget Show and Hide.kmmacros (7.1 KB)

1 Like

This is the first time I've tried this set of macros. This latest set of macros won't work because there is no variable in my system called ThisOSVersion.

I'm curious why you added an action to show and hide Mission Control. After I fixed the first issue, related to the variable ThisOSVersion, your macro works fine even when I disable the AppleScript action(s).

Sorry about that. “ThisOSVersion” is simply the MacOS version. E.G. “14.2”.

The reason for the Mission Control nonsense is that the widgets weren’t always coming out from hiding. It needs Mission Control to make the showing of the widgets reliable.

Yes, that was easy to figure out, but other people may need to adjust your macro to make it work, so I mentioned the issue here.

Have you considered this action to force a refresh of the desktop? It seems to work for me:

It looks scary, but it seems very fast, and restores every window as far as I can see.

Actually, I think I did try that but it was several weeks ago, and I don’t remember the outcome. I vaguely remember I had the same reliability problem.

But I can try it again.

You are most welcome. :hugs: