Swap glyphs, update kerning

Hi, I need to swap a bunch of glyphs (/glyphName.alt with /glyphName). I can update if the renamed glyphs are used as left, right or widthMetricsKey in other glyphs and KerningGroups but I can’t find the right way to update the kerning, which should be the approach? (scripting-wise)
Many thanks for your help.

You can use the “Rename Glyphs” custom parameter to do the switching on export. So you might not need to do that per script.

The kerning is directly connected to the glyph. So renaming the glyph keeps its kerning. Do you mean that the kerning from /glyphName should be switched with the kerning form /glyphName.alt? I would expect that the kerning stays with the glyphs?

No, kerning should switch too but didn’t want to have it in the “Rename Glyphs” custom parameter to get it at export time. I managed though.

If you rename the glyphs, the kerning stays with the glyph.