Creating List Filters with Code

Hi,

I would like to create list filters using macro code. Is this possible?
For example, I want to create a script that puts all glyphs with the extension “matraUu.kn” into a list filter called “R_matraUu”. Then I want to take all glyphs with the extension “matraAa.kn” and put them in a list filter called “R_matraAa”. Then, I want to put both into a folder called “Right Kerning Groups”.

I use this folders and filters to help with creating and organising kern groups, which can get overwhelming in scripts like Kannada and Telugu. I don’t want to keep doing it manually every time I move to a different system. I would rather run a predetermined script.

Cheers,
Taresh

PS The list names and glyph extensions are not going to always match. I’m simply interested in the script that can help create a list filter.

The color flow plugin has some sample code: Color-Flow/Color Flow.glyphsPalette/Contents/Resources/plugin.py at 8b1f8690e84c5024f1becc9eefcc23fcf36660e4 · HugoJourdan/Color-Flow · GitHub