Keyboard Layout Macro Fails

I had a macro that once worked: it changed keyboard layouts from English to Greek, triggered by a hotkey. Lately (again) it has been giving me errors:

Other layouts work; it's just this one, which is available to me if I press command-option (rotating through assigned kb layouts).

I've gotten it to work only sporadically since the problems arose (quite a while ago). Help appreciated. thanks.

It further contains an error -43.

However, I just reinstalled KM app and rebuilt the offending macro and now it is working again. So something happens and the macro beings to fail (via corruption?). Would love to keep it working without a hitch. tx

Hey @jipnet,

Unless Peter can recreate this on his test machine it will be very difficult if not impossible for him to fix.

What version of macOS are you using and what version of Keyboard Maestro?

Please also look in the Keyboard Maestro Engine log and post the entire error.

You can open the logs folder from the Keyboard Maestro Editor's Help menu, or you can use my macro:

Open the Keyboard Maestro Engine Log in the Console or BBEdit

-Chris

Most recent MacOS.

Here is the relevant portion of the logs:

2018-06-01 10:55:34 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:55:34 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:55:39 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:55:39 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:56:13 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:56:13 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:56:56 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:56:56 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:12 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:12 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:12 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:12 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:16 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:16 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:17 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:17 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:17 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:17 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:46 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:46 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:46 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:46 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:57:46 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:57:46 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:58:08 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:58:08 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:58:17 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:58:17 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:58:27 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:58:27 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:58:38 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:58:38 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:58:39 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:58:39 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:58:52 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:58:52 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:58:53 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:58:53 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 10:59:23 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 10:59:23 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:00:16 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:00:16 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:00:20 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:00:20 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:01:28 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:01:28 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “NewAthenaUnicode” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:01:59 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:01:59 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:02:12 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:02:12 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:02:30 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:02:30 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:02:48 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:02:48 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:03:28 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43
2018-06-01 11:03:28 Failed to select keyboard layout org.apagreekkeys.keyboardlayout.gku2015.greekkeysunicode(us) error -43 In macro “Trying” (while executing Set Keyboard Layout to “GreekKeys Unicode(US)”).
2018-06-01 11:03:45 Failed to select keyboard layout

Does that help explain anything? tx

After fiddling with the script (reproducing it again) I got it to work, then it failed, with these logs:

019-06-16 20:03:19 Running application query took a while (5578 us)
2019-06-16 20:03:22 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:03:26 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:03:29 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:03:32 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:03:34 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:03:49 Running application query took a while (3456 us)
2019-06-16 20:03:53 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:03:55 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:04:01 Running application query took a while (4995 us)
2019-06-16 20:05:43 Running application query took a while (9690 us)
2019-06-16 20:05:43 Running application query took a while (3199 us)
2019-06-16 20:06:17 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:06:24 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:06:43 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:07:53 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:08:29 Running application query took a while (13847 us)
2019-06-16 20:08:34 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:08:58 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:09:18 Running application query took a while (6253 us)
2019-06-16 20:09:26 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:09:27 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:09:29 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:09:31 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:09:42 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:09:44 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:09:46 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:09:47 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:09:52 Running application query took a while (4060 us)
2019-06-16 20:09:52 Running application query took a while (8814 us)

I've tried adding a pause of 1.5 seconds between the font change and the keyboard change. It helps a little, not perfectly.

2019-06-16 20:12:29 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:12:33 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:12:34 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:12:40 Running application query took a while (6477 us)
2019-06-16 20:12:53 Running application query took a while (16810 us)
2019-06-16 20:12:56 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:12:57 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:13:02 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:13:04 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:13:15 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:13:17 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:13:22 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:13:24 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:13:28 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:13:30 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:13:43 Running application query took a while (7047 us)
2019-06-16 20:13:45 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:13:47 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:13:49 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:13:52 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:14:00 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:14:06 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:14:12 Execute macro “TNR” from trigger The Hot Key ⌃⌥R is pressed
2019-06-16 20:14:16 Execute macro “NewAthenaUnicode” from trigger The Hot Key ⌃⌥A is pressed
2019-06-16 20:14:24 Running application query took a while (3875 us)

-43 is “file not found”. If the layout in a normal location?

There is nothing in those logs that indicate an error, so I am afraid I have no idea why it might be failing.