Things which I am, do, love, fear, and aspire to!

Workaround for Keyboard Maestro no longer speaking text in Yosemite

· by Ivan · Read in about 2 min · (319 Words)

I use Keyboard Maestro for automation, but also to speak information like the time, and Mac battery status.

When I upgraded my Mac to Yosemite I first dealt with the Keyboard Maestro Yosemite Accessibility workaround (accessibility in this case, referring to granting Keyboard Maestro permission to control one’s Mac).

Next, I noticed that my macros which spoke things, no longer worked. The Keyboard Maestro Frequently Asked Questions mentions this issue, and that one possible solution is to call a shell script instead of Keyboard Maestro’s internal Speak Text action:

There is a bug in the NSSpeechSynthesizer that returns isPlaying as false immediately. This means the Speak Text Action in Keyboard Maestro finishes immediately, so the text is not spoken. As a workaround, you can set a variable named “Text to Speak” to the text you want, then you can use the Execute Shell Script action with the command: say “$KMVAR Text to_Speak”

I’d rather keep using the Keyboard Maestro provided Speak Text action, presuming that this bug will be fixed. I also didn’t like the extra layer of a shell script to maintain along side my speaking macros.

It turns out that a workaround with less impact, is to follow the macro Speak Text action, with a Pause action which waits for at least the number of seconds you expect it will take to speak your text. I believe this causes the macro to continue running, while the text has a chance to be verbalized, keeping isPlaying from incorrectly returning false to Keyboard Maestro and causing the macro to exit prematurely.

I got this idea when I realized that macros which speak something and then perform another action which takes a while, were able to speak the text without being cut off. rsync script, my «starting to copy…» text is spoken.

For more information on the Speak Text and Pause Keyboard Maestro actions, see the Keyboard Maestro Actions page.

Comments