Very cool, thank you Michael.
So - I have a 1600mmPro mono, and I ran the flat wizard in SGP for each filter. With my light source for flats, I have a different exposure length required for each filter in order to get at least 30,000 in my adu max.
I then pop the lens cap on, and run the exact same sequence to create dark-flats - at the same temperature.
When I use your script - PixInsight still seems to throw all the dark-flats together in a single group - whereas I would expect to be able to group them (as I can say flats or lights) by the filter. So I would expect the OIII dark-flats to be removed only from the OIII flats etc.
Perhaps I'm missing a way to do this?
At script runtime, does it indeed separate out by filter and apply the dark-flats to each corresponding filter flat?