ExtendScript: duplicate() and general object management within a shape layer
I hope I'm wrong, but after 5h of investigation, C-GPT and me gave up on this.
As far as it looks, it is not possible to organize shape layer content via script? I've tried duplicate() and another recreational approach (duplicate would be best as my content has expressions) but it seems impossible. for-loops keep breaking after the first successful duplication, throwing an alert that the object from the duplicate line was invalid.
GPT says that the "invalid object" is a common bug when operating inside shape layer content and that duplicating, removing or sorting of shape content is just not possible.
I do hope that there's a way though, as I've always preferred a single-layer workflow for shapes whenever possible so I can quickly import them as animation presets + they don't clutter up comps. This works fine in most cases, but if I want to dynamically generate content - tables, diagrams etc. - into these templates, with various amounts of the same thing, I need ExtendScript. And I would really need to rework a lot of templates with complex expression logic to change that workflow.
