AppleScript to Toggle Desktop Widgets

I’m a fan of the new Sonoma Desktop Widgets. However, I also make a living making screencasts and having all those widgets on screen can sometimes be a pain. There is a setting you can toggle under the Desktop & Dock settings:

The problem with this, of course, is that it’s a pain in the neck to get there. Who wants to do all that mousing and clicking? I wanted to automate this button so I can run a script that sets me up for screencasting and, among other things, turns off Desktop Widgets. So here’s a script that does just that. This was built with help from the AppleScript Sensei himself, Sal Soghoian. Below is a link to the zipped script file, as well as the script in plain text. I run it as part of a Keyboard Maestro macro that I’ve tied to a keyboard trigger. Enjoy.


tell application "System Settings"
	activate
	reveal anchor "Widgets" of pane id "com.apple.Desktop-Settings.extension"

	repeat
		set currentPane to get current pane
		if currentPane is pane id "com.apple.Desktop-Settings.extension" then
			exit repeat
		else
			delay 1
		end if
	end repeat
end tell

delay 1

tell application "System Events"
	tell process "System Settings"
		set targetControl to checkbox "Show Widgets" of group 6 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window 1
		click targetControl
	end tell
end tell

tell application "System Settings" to quit

Is AI Apple’s Siri Moonshot?

The Information has an article by Wayne Ma reporting Apple is spending “millions of dollars a day” on Artificial Intelligence initiatives. The article is pay-walled, but The Verge summarizes it nicely.

Apple has multiple teams working on different AI initiatives throughout the company, including Large Language Models (LLMs), image generation, and multi-modal AI, which can recognize and produce “images or video as well as text”.

The Information article reports Apple’s Ajax GPT was trained on more than 200 billion parameters and is more potent than GPT 3.5.

I have a few points on this.

First, this should be no surprise.

I’m sure folks will start writing about how Apple is now desperately playing catch-up. However, I’ve seen no evidence that Apple got caught with its pants down on AI. They’ve been working on Artificial Intelligence for years. Apple’s head of AI, John Giannandrea, came from Google, and he’s been with Apple for years. You’d think that people would know by now that just because Apple doesn’t talk about things doesn’t mean they are not working on things.

Second, this should dovetail into Siri and Apple Automation.

If I were driving at Apple, I’d make the Siri, Shortcuts and AI teams all share the same workspace in Apple Park. Thus far, AI has been smoke and mirrors for most people. If Apple could implement it in a way that directly impacts our lives, people will notice.

Shortcuts with its Actions give them an easy way to pull this off. Example: You leave 20 minutes late for work. When you connect to CarPlay, Siri asks, “I see you are running late for work. Do you want me to text Tom?” That seems doable with an AI and Shortcuts. The trick would be for it to self-generate. It shouldn’t require me to already have a “I’m running late” shortcut. It should make it dynamically as needed. As reported by 9to5Mac, Apple wants to incorporate language models to generate automated tasks.

Similarly, this technology could result in a massive improvement to Siri if done right. Back in reality, however, Siri still fumbles simple requests routinely. There hasn’t been the kind of improvement that users (myself included) want. Could it be that all this behind-the-scenes AI research is Apple’s ultimate answer on improving Siri? I sure hope so.

Craft Import Automation (MacSparky Labs)

I’m moving some data into Craft, and doing it manually was driving me crazy. So I made two different Shortcuts to automate it. One is really easy, but requires a few steps by you when you run it. The second option is fancier and more complex, but does everything automatically. Enjoy!…

This is a post for MacSparky Labs Tier 2 (Backstage) and Tier 3 (Early Access) Members only. Care to join? Or perhaps do you need to sign in?

OmniFocus Voice Control Tutorial with Sal Soghoian (MacSparky Labs)

This month’s Friends of Dave interview is a special one. Sal Soghian (formerly with Apple, now working with the Omni Group) spent an hour with me doing a walk-through on how to set up and start using the new Javascript-based voice automation in OmniFocus. Sal has, in essence, created an entirely new user interface for OmniFocus, letting you fully control the app with your voice. Moreover, you can add your own custom commands. In this video, I share my screen and Sal walks me through the entire setup process. Watch this video with the current version of OmniFocus installed on your Mac and you’ll be voice-controlling within the hour…

This is a post for MacSparky Labs Tier 2 (Backstage) and Tier 3 (Early Access) Members only. Care to join? Or perhaps do you need to sign in?

Using AppleScript to Announce Glanceable Information

Ernest Rudak (Twitter)(website), a blind Mac power user, wrote a really informative piece on using AppleScript to announce glanceable information. Of course, as someone who’s not visually impaired, there are a lot of things I take for granted or never really thought about, like getting information like time, day, or date with a quick glance on my iPhone. Ernest, with an interest in automation, Keyboard Maestro, and keyboard shortcuts, came up with a solution by writing an AppleScript. Have a go and read it for yourself to see what works for him. I agree with him that the best automations aren’t the ones filled with endless lines of code, but the “small utilities which smoothly fits in your everyday workflow.”

The Sad Demise of the Harmony Remote


Harmony Remote.JPG

Last week we got notice that Logitech will no longer be making the Harmony remote. I’ve heard from so many listeners and readers over the years who made the Harmony remote an essential piece of their home-automation infrastructure. I tried using one but found it just didn’t work with my brand of TV. Nevertheless, I could see the clear value it had.

It’s interesting that as we go deeper down this rabbit hole of Internet-of-Things, we’re losing a vital tool for many people. Maybe the answer going forward is for TVs to become more automation aware, but I suspect that is asking a lot in an already low-margin business.

If you have an existing Harmony remote, Logitech promises ongoing software updates, but I don’t expect that to last forever. I’d start looking for your Plan B.

The Idea of Shortcuts on the Mac

This week Jason Snell wrote an excellent article about the need for Apple to bring Shortcuts to the Mac. I’ve been thinking about that article a lot. My position on Apple bringing Shortcuts to the Mac has always been, “wait”. The reason being that automation is alive and well on the Mac. With a much more open platform and the existence of Apple events, AppleScript, Keyboard Maestro, Hazel, TextExpander, and the ability to run virtually any scripting language via the terminal, there is very little that I can not automate on my Mac.

The iPhone and iPad, however, are a much different story. Apple had no automation tools on its mobile platforms until Shortcuts came along. Shortcuts is, practically, the only way to automate on mobile and for years now there has been lots of low-hanging fruit on mobile that Shortcuts has yet to pick.

I wanted Apple to keep the Shortcuts team working exclusively on mobile so it could get better rather than spend its time moving Shortcuts over the Mac. However, Jason’s article has moved me on this. While my argument about waiting made sense a few years ago, nowadays we’ve got Apple Silicon Macs and Shortcuts on mobile is a lot more powerful than it used to be. Moreover, even with all the above-mentioned Mac automation tools, there is room under the tent for one more. If done right, we’d be able to pull Shortcuts actions into scripts and Keyboard Maestro and make those tools even more powerful.

So put me on team Mac Shortcuts. Let’s hope WWDC 2021 brings us Automators some new toys.

ThoughtAsylum Icon Generator

Stephen Millard has made an ingenious shortcut that solves the problem of generating icons. The particular itch that Stephen was trying to scratch was the development of icons for his Stream Deck. However, if you do any automation, you’re constantly bumping into places that you’d like to have icons. One of the things I particularly like about Stephen’s solution is the way it works with Apple’s SF Symbols, which I like.
Either way, if you want to render 10 or 10,000 icons this weekend, check this out.