Hi Andrei.
Thank you for Your answer and help. The script works great, it does exactly what I want. Its action ends with a message “Unable to execute script at line 6. unndefined is not an object”, but apparently that’s not a problem:)
I just have one more question. In line 4 we have “var comp = app.project.activeItem;”. Does this mean that the script should only work on selected layers? At the moment it renames all the layers in the composition I’m currently in. It’s not a problem, but I’m asking more out of curiosity.
Thank You very much, you helped me save a lot of time 🙂