[SOLVED] Terminal Command/Script to Toggle Time Announcement On and Off

I am interested to create a macro that will allow time announcements by mac every 30 min during work hours/days, but not otherwise. I don't want just to mute the volume during times I am at home. I wonder if there is a Terminal command/script to toggle time announcement on and off which I can implement in my macro.

You feel sure that you need the terminal ?

A periodic Keyboard Maestro trigger would do the same:

Screenshot 2022-09-18 at 16.15.29

Periodic trigger is what I was planning to use, but I wonder how to actually toggle it on/off - actual action.

Here's one approach: Toggler Macro

Thank you @mrpasini. I think I did not explain my problem well.

My difficulty is that I don't know how I can switch the "Announce the time" on and off programmatically to add this action into the keyboard maestro, so I can toggle it later (see picture attached).

Ah, I thought you already had a macro you wanted to toggle. But I see that isn't trivial! Take a look here for some ideas.

Thank you, I will give it a try.

This is mentioned in @mrpasini's linked page and is where I would start:

Avoid the System Events UI scripting if possible and use the shell script.

It appears to work on macOS 10.14.6 Mojave, but that doesn't mean it will on more modern system. You'll have to test.

-Chris

1 Like