Rename kerning classes when updating glyphs names

When updating old glyphs (afii***.sc) we get the right name (whatever-cy.sc) and it’s updated in the kerning dict. The old kerning classes keep the old name @afii***.sc
Is there a way to get the class name updated also?
many thanks

You can rename the classes in the kerning panel. But you could keep it. It is really just a name.

Is there any programmatically way of doing this in a batch? (renaming the kerning class name)
I know it can be done by hand but would be a pain. The designers prefer to have a more comprehensible reference in the class name, related to current glyph names.
thx

Where did you get the file from, originally? Did you open a .otf?

Nope, coming from a .vfb old file that we’re porting to .glyphs

I did some good results in opening the glyphs-file in a plaintext editior, using https://glyphsapp.com/tutorials/system-services and resulting in a batch renaming for classen/metric-keys/ot-features all at once.

Thanks for the tip but wasn’t enough, I tried exporting the .metrics and do the thing, it does change the glyph names but still keep the classes names.
"@MMK_R_afii10092;afii10084 afii10092" p.e goes to “@MMK_R_afii10092;te-cy hardsign-cy”

Have you tried renaming the group in the Window > Kerning? That works well for me.

Do you mean double-clicking to edit the class name and doing the ‘Services’ thing?

In the Kerning window:

Yes, it works, but this way I’d need to repeat this hundreds (in fact thousands) of times…

I’ve also tried using robofab library but seems neither to work:

from robofab.world import CurrentFont

cf = CurrentFont()
for grname, glyphs in cf.groups.items():
	if grname.startswith('@MMK'):
		# current group name
		print grname, cf.groups[grname]
		# copy the values to a new key
		newGroupName = 'myNewGroupName'
		cf.groups[newGroupName] = cf.groups[grname]
		# the new group doesn't exists
		print newGroupName, cf.groups[newGroupName]

How many kerning classes do you have? Or do you mean so many fonts?

Right now might be +20 fonts with a considerable amount of classes that would be nice to rename (each). In the near future this number will grow… And fonts have a lot of glyphs (therefore a buch of classes to rename). No way of going through one by one…

I guess, in this case, the easiest way would be to do the renaming in a text editor, and do a search+replace on multiple files.

Which text file should I use?
Would export the kerning feature and import it back again work? (is there a way of doing this both ways export/import?
thx!

No, open the .glyphs file itself in a text editor.