Copy link to clipboard
Copied
Dear All
I want to duplicate a layer structure, as the "Duplicate Layer" submenu do with Javascript code, but I can't.
I can duplicate only PageItems or selected object, but no Layers.
Anybody knows how can I do it ?
Copy link to clipboard
Copied
Not sure that you can in one command.
have a look at this thread and see if it helps:
Copy link to clipboard
Copied
Thanks for your answer.
The problem with this code is, that it can't duplicate also the sublayers, and the sublayer elements.
Sure I can write a recursive function, but I think there should exist a duplicate function somewhere ( for Photoshop script exist ! ) or a small trick, but I can't find it.
Thanks
Copy link to clipboard
Copied
you can't compare PS or InD scripting to Illustrator, they're much better supported than Illustrator is.
small trick...create a new action, duplicate a layer (via layer's panel menu), stop recording. Write a script to play such action (it will duplicate the Active Layer).