"failed to select keyboard layout"

Trying to switch kb layouts, and I keep encountering the message "failed to select keyboard layout" when I do. I initiate this with a trigger (keystroke combination); the only enabled command is "Set keyboard layout to...".

Is there a reason why?


Sorry but there is not enough info here to help. Please see

and also specify which keyboard layouts you are trying to select
together with an image of your current macro

Let me be more specific. I've written to this forum about the issue before but maybe things have changed.

I type in Ancient Greek with a Greek font (NAU) and in English with Times New Roman. The Greek is mapped onto a Greek Keyboard layout called "GreekKeys Unicode (US)", localized for US keyboards.

To switch to the font and use it properly (to render Greek on the screen/page) I need to switch keyboard layouts. To return to English I need to return to a US layout (either US or ABC Extended).

This is my macro:

I added a pause because it seemed to help at one point.

This is my return to English macro:

The TNR macro works fine. The Greek one produces the error message.

Let me know if you need more specifics. Thanks.

Please try invoking the switch to greek from the KM status menu

Where did you get the Greek keyboard definition file from?
Is this a standard Apple key file definition?
It might be worth trying a "different supplier/source" for your Greek key definitions

Apart from finding your original post, I also found these, which might be relevant,



There is also a hint on stackoverflow that you may need a command +space or similar to complete the switch, but I think yours is failing before that point.

Finally there may be an alternative way using a shell or applescript.

I can now report back a solution that I just found: KAWA, an app from this site (Github). Works perfectly. I recommend it to all. I was able to incorporate Kawa's keystrokes into my KBM macros.

Thanks for the tips.

1 Like