Given this code:
#@gui:1.Section=choice(1,"Gray","Color")
#@gui:2.Section=choice(0,"Gray","Alpha")
#@gui:3.Section=choice(0,"Color","Alpha")
#@gui:4.Section=choice(0,"Gray","Color","Alpha")
#@gui:5.Section=choice(1,"Gray","CMY")
#@gui:6.Section=choice(1,"Gray","CMYK")
#@gui:7.Section=choice(0,"CMY","Alpha")
#@gui:8.Section=choice(0,"CMYK","Alpha")
#@gui:9.Section=choice(1,"Gray","CMY","Alpha")
#@gui:10.Section=choice(1,"Gray","CMYK","Alpha")
#@gui:11.Section to use=int(1,1,10)
How would I retrieve the lower-case version of chosen string within choice. Note the “Section to use”, so, I would like to retrieve only the selected one.
It would be easier if G’MIC GUI plugin can have something like text_choice to choose string instead of number, but it does not exist.
Something like this is what I thought off:
$=arg
section_space=${arg\ $section_to_use,"gray,color","gray,alpha","color,alpha","gray,color,alpha","gray,cmy","gray,cmyk","cmy,alpha","cmyk,alpha","gray,cmy,alpha","gray,cmyk,alpha"}
selection_of_section_space=${arg$section_to_use}
section_space=${arg\ $selection_of_section_space+1,$section_space}
And I had to create this part via Python REPR to avoid doing it by hand.
"gray,color","gray,alpha","color,alpha","gray,color,alpha","gray,cmy","gray,cmyk","cmy,alpha","cmyk,alpha","gray,cmy,alpha","gray,cmyk,alpha"