Closing unlocked kerning pairs

Hello everyone, is any script to close all the unlocked kerning pairs? thanks in advance.

Do you need it to be a script?

you can do it manually from the Kerning panel. First run “Compress Kerning” from the gear button. Then filter for glyph kerning and delete all of the remains entries.