' Bayer Extract ' It operates on all the images currently selected in MaximDL ' It creates 4 new images from the Bayer channels, prefixing the names with the color ' It does not save the files; you do that ' George Silvis SGEO@GASilvis.net 'Option Explicit Set MaximApp= CreateObject("Maxim.Application") Set AllDocs = MaximApp.Documents For I = 1 To AllDocs.Count Set targetDoc= AllDocs.Item(I) targetName= targetDoc.DisplayName 'wscript.echo targetName 'wscript.echo targetDoc.FilePath targetDoc.Duplicate ' copy it Set dupDocR= MaximApp.CurrentDocument dupDocR.DisplayName= "R_" & targetName dupDocR.ExtractBayerPlane(1) call dupDocR.SetFITSKey("FILTER", "TR") dupDocR.Modified= true targetDoc.Duplicate ' copy it Set dupDocG1= MaximApp.CurrentDocument dupDocG1.DisplayName= "G1_" & targetName dupDocG1.ExtractBayerPlane(2) call dupDocG1.SetFITSKey("FILTER", "TG") dupDocG1.Modified= true targetDoc.Duplicate ' copy it Set dupDocG2= MaximApp.CurrentDocument dupDocG2.DisplayName= "G2_" & targetName dupDocG2.ExtractBayerPlane(3) call dupDocG2.SetFITSKey("FILTER", "TG") dupDocG2.Modified= true ' combine G's dupDocG1.Duplicate Set dupDocG= MaximApp.CurrentDocument dupDocG.DisplayName= "G_" & targetName dupDocG.Add(dupDocG2) call dupDocG.SetFITSKey("FILTER", "TG") dupDocG.Modified= true targetDoc.Duplicate ' copy it Set dupDocB= MaximApp.CurrentDocument dupDocB.DisplayName= "B_" & targetName dupDocB.ExtractBayerPlane(4) call dupDocB.SetFITSKey("FILTER", "TB") dupDocB.Modified= true Next wscript.echo Done