Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I duplicate and move a selected group?

New Here ,
Dec 21, 2017 Dec 21, 2017

I’ve got a group selected and was able to move that group with `translate` easily. I now need to duplicate that group and move the duplicate to another location. `group.duplicate(doc, ElementPlacement.PLACEATEND);` gives me the error “Error: Target layer cannot be modified”.

Suggestions?

TOPICS
Scripting
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Dec 22, 2017 Dec 22, 2017

Hello, brandond15025946.

Is the layer on which the group is duplicated locked or hide?

Keep the layer editable. (unlock and show)

How about this?

group.duplicate(group.parent, ElementPlacement.PLACEATEND);

Translate
Adobe
Contributor ,
Dec 22, 2017 Dec 22, 2017

Hello, brandond15025946.

Is the layer on which the group is duplicated locked or hide?

Keep the layer editable. (unlock and show)

How about this?

group.duplicate(group.parent, ElementPlacement.PLACEATEND);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2017 Dec 22, 2017
LATEST

Shoot… it’s the parent bit I missed. I was targeting the wrong container. Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 22, 2017 Dec 22, 2017

Bonjour;

layer.locked = false;

layer.visible = true;

group.duplicate(layer, ElementPlacement.PLACEATEND);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines