A piece of code does not work on multiple layers

Hello,

Few months ago @David_Tschumperle gave a nice piece of code to "transfer layers’ name onto the layer itself > Transfer Layer's name to the layer itself - #5 by David_Tschumperle

font_height=65
to ${-gui_layer_name},100,230,$font_height

After updating it seems to not work anymore as intended
I have a bunch of layers
screenshot_20230422-151015

As you can see the naming has a period in it (it’s important to notice it)
When using the code, if the Option is None (Allow multi-layers) The name is correctly written,

BUT, the script will put the same name (the selected layer before opening G’MIC) to all layers, instead of transferring each layers’ name to the proper layer

Now if I use any other Channels option like All, and because of the period in the name, it add a _c1 before the dot/period (when there is no period, it does not add _c1)

But this time, it work properly on transferring the right layer’s name to the layer itself

I Updated recently to G’MIC 3.2.3, but I can’t tell if it’s G’MIC or me doing it wrong, can someone tell me if I’m doing it wrong, or how to not have the _c1 appear with other channels options.

Thanks a lot for reading

Try this:

font_height=65
foreach { to ${-gui_layer_name},100,230,$font_height }

Thank you so much, it’s working like a charm!

I will update this thread, because I’m preparing a tutorial about this post > Reddit - Dive into anything to show that’s possible using G’MIC (a person who want to input different prices with the same label)

Again thank you so much @David_Tschumperle and have an absolute fantastic day.

1 Like