Macro panel error: File "objc/_convenience

I came across some scripts that weren’t working in G3. Trying to update them, I am running into this error:

File "objc/_convenience_mapping.pyc", line 19, in __getitem__objectForKey_
File "objc/_convenience.pyc", line 118, in container_unwrap

What does this indicate? Is it something that needs to be updated with the script, glyphs, or on my end?

The specific script is Show Kerning Pairs

3.0.3 (3091)

There should be more error message. Can you post all of it?

It’s this type of message with any font I try.

 Traceback (most recent call last):
      File "<macro panel>", line 86
      File "objc/_convenience_mapping.pyc", line 19, in __getitem__objectForKey_
      File "objc/_convenience.pyc", line 118, in container_unwrap
    KeyError: {
    	@MMK_R_A = 10;
    	@MMK_R_C = -5;
    	@MMK_R_C.2 = -20;
    	@MMK_R_De = 10;
    	@MMK_R_E-cy.2 = -20;
    	@MMK_R_T = -40;
    	@MMK_R_V = -40;
    	@MMK_R_W = -35;
    	@MMK_R_X = 10;
    	@MMK_R_Yacute = -25;
    	@MMK_R_Zcaron = 5;
    	@MMK_R_backslash = -60;
    	@MMK_R_c = -5;
    	@MMK_R_f = -20;
    	@MMK_R_guilsinglleft.cap = -15;
    	@MMK_R_hyphen = -10;
    	@MMK_R_question = -20;
    	@MMK_R_quotedbl = -50;
    	@MMK_R_s.2 = -5;
    	@MMK_R_slash = 10;
    	@MMK_R_t = -10;
    	@MMK_R_v = -30;
    	@MMK_R_w = -25;
    	@MMK_R_x = 10;
    	@MMK_R_yacute = -25;
    	@MMK_R_zcaron = 10;
    }

What is at line 86 in the macro panel? That is where the the error comes from (second line in the error message)

This is what I am using in the panel. It’s a modified version of Wei’s code by adding this:

if Glyphs.versionNumber >= 3.0:
	kernDict = thisFont.kerning
else:
	kernDict = thisFont.kerningDict()

ShowKerningPairs_modified.py.zip (1.5 KB)

It seems to be the same as this: Key error for kerning dict - #2 by oneweioranother