How to Implement Voice Control/Triggers for KM Macros

That is very interesting. I like to adjust the volume, depending on various situations, such as working from home, listening to Audiobooks, softly in background, loud when I'm in the mood, etc. I've set up AppleScripts to adjust the volume and disbursement of the AirPlay speakers. The KB macros call the AppleScripts. Some of them are set by day of the week or time of the day or other circumstances. I can also trigger them with Alexa voice commands.

My speakers are HomePods so I don't think I need to use your approach since (with my Apple Music subscription) I can ask SIRI directly for music actions like Play, Pause, go back, etc. I can even interrupt a song playing with questions like "Hey Siri, who plays the guitar in this song?" or "Hey Siri, when was this song released?" Apple has an API called SIRIkit which applications like KM (hint, hint) can interface with to perform actions within an application. I'm not sure if customers of KM want to be able to say things like "Trigger the Macro: Play Pool" but that's the sort of thing SIRIkit can do. Personally I'd even like the KM web interface to be SIRIkit enabled to allow me to use voice control to control KM from outside my home, but I really don't sense that Peter would do that - maybe in KM version 11.

I want to be able to click my middle mouse button instead of saying "Computer." Is this possible? I can use Logitech Options to map my middle mouse button to a keystroke (or to various other actions). The problem is that when I set it up to say "Computer" before issuing a command, the command works reliably. But when I don't say "Computer" and only enable dictation (by pressing Fn twice, for example) then I have to say the command three or four times before the Mac recognizes it. So the ideal would be to press the mouse middle button and have Logitech Options press a keystroke that makes Keyboard Maestro say "Computer" to the computer. Is that possible?
P.S. Keyboard Maestro's "Speak Text" action doesn't seem to work. I guess the computer doesn't listen to itself when it speaks.

As for your "P.S. comment", I'll test that myself. It's a good idea. As for your main comments, my first suggestion is "reboot". As I said in my original post, voice recognition can get corrupted. Reboots can fix that. My gut tells me that you can't achieve what you are trying, but I'll give it some thought. I never tested the Fn Fn trigger.

Sleepy, Have you tested my "P.S. comment"?

Here is another example @Sleepy & @bburd how to use Siri for KM macros. But then from the iPhone or iPad. Because they are 99% within my call range... no problem for me :wink:

Sorry for the slow response. My house has HomePods and iPhones which DO respond to commands from the "Speak Text" action. Perhaps that helps you out a bit. However you appear to be right, I can't get the Accessibility mode to recognize sound from the Mac itself. It seems to ignore its own sound output. That's a very good idea you had, and I wish I had thought of it myself.

So I thought I'd try to trick it by going to the Preferences and changing the output of my computer to be my HomePod, with my accessibility/dictation feature still enabled. Guess what, something odd happens. When I issue the KM Action to "Speak Text" the action starts speaking (correctly through my HomePod) but then cuts out. I have a feeling that this isn't really a bug in KM, although at first glance it looks that way. I think there's something deeper going on here that KM can't fix. But then when I disable Accessibility/Dictation then KM works fine.

I think it's a legit question to ask PeterNLewis, why the Speak Text action fails to speak more than one second of text when Dictation is enabled in macOS. But I think KM is not at fault here. It's probably built-in to macOS as a feature. I'm not sure if that feature can be disabled. That would take someone a lot smarter than me to answer.

I would like KM to be enhanced to be able to activate macros by voice from KM. The reason I want this is because I am a high-level quadriplegic. I have no use of my limbs. I operate my computer completely hands-free using Dragon Professional Individual (DPI) for Mac. DPI for Mac was discontinued in October 2018. I have been able to continue to use DPI for Mac up until Catalina. I used DPI for Mac through macOS Big Sur beta. Unfortunately when macOS Big Sur release came out DPI for Mac became unstable. Because of this I am trying to move to macOS Voice Control. When I connect to work using XenDesktop, where I control my work computer using Dragon Professional Individual for Windows, I need to disable macOS Voice Control which I could do using macOS Voice Control. The problem is once Voice Control is off I need to somehow enable it again when I leave my work computer. Unfortunately there's no way to do this at the moment hands-free. If KM was modified to activate macros by voice I could have KM enable macOS Voice Control.

Hopefully this makes sense. If not, I will be happy to try to explain it again.

Greetings

I agree that having this built-in to KM would be ideal

But right now you can activate KM macros by voice - I just gave it a try.

Create a custom voice command using the instructions on this page https://support.apple.com/en-mt/guide/mac-help/mchl3eb7b79a/mac . Then have the action be to open a URL. Then set up your KM macro to be triggered by URL and make that the URL executed by your voice command. It works well.

image

@rkaplan I have already created a macOS Voice Control command to trigger a KM macro. But I need a way of being able to turn on macOS Voice Control by voice. That's why I'm requesting KM to add a new activation type for by voice. Then I can use KM to turn our macOS Voice Control. Sorry if that was not clear in my original post.

Doesn't Accessibility voice control stay on once turned on?

@rkaplan please reread my original post to understand my use-case.

OK I see the issue now

Two suggestions:

(1) There are a number of ideas in this thread on how to turn voice control on/off on the Mac. It can be done via an Applescript; you can save the Applescript as an App.

Could you write one Applescript which turns on your Dragon dictation and turns off Mac dictation. Then another one which turns on Mac dictation and turns off Dragon dictation?

(2) Do you have an iPhone or iPad with accessibility features turned on, i.e. the Grid to control the iPhone/iPad by voice? If so then you could use the iOS version of Keyboard Maestro. With it you could use voice control on the iPhone or iPad to execute any Macro currently on Keyboard Maestro on your Mac. I suspect this is the most fail-proof solution. One of the macros you execute by voice on iOs could even be an Applescript to turn Mac voice recognition on or off.

@rkaplan thanks for the suggestions. I do have an iPhone and an iPad that have Voice Control enabled. I did not know there was a way to use KM on iOS to execute KM macros on a Mac. If you have a link that documents the setup please share it with me. I would like to give it a try.

By the way "Hey Siri" can enable/disable Voice Control if you simply say "Hey Siri turn on voice control" or "Hey Siri turn off voice control". The unfortunate thing about this is the mac mini doesn't support "Hey Siri" and you cannot invoke "Hey Siri" on a laptop when the lid is fully closed. 2 more of my use-cases and the reason I'm looking for a KM solution.

It is a regular app available for iPhone or iPad

1 Like

Hi @tscheresky, I myself use a Siri shortcut with an SSH script for this. Like in this example here:

Here is a tutorial about it:

1 Like

Here's an easy option.

Export a macro you want to trigger by voice as a KM Trigger File.

With Voice Control turned on, select the Trigger File from wherever you have saved it and say the Voice Control command "Make this speakable". (Selecting a Finder file and saying the command to create a custom Voice Control command is quick, easy, and slick!)

Edit the resulting dialogue and save it.

You then are able to speak whatever word or phase you have specified and that macro will trigger.

Here is a video demo with Gary at MacMost doing this: https://macmost.com/creating-custom-voice-control-commands-for-your-mac.html

It seems as though this very cool app is no longer working with iOS 15.

The messages says: This app needs to be updated. The developer of this app needs to update it to work with version of IOS. (IOS 15)

This looks very cool. Any chance this might be updated for IOS 15 any time soon?

No.

Read this thread;

Any roadmap for adding this feature?