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

Move all layers and layersets inside a layerset names as "Main_Group" using javascript

Participant ,
Dec 21, 2020 Dec 21, 2020

Copy link to clipboard

Copied

Hi,

How to move all layers and layersets inside a new layerset named as "Main_Group" using javascript and sctipt listener.

 

Note: don't change Layers and layerset order.

 

Thanks

TOPICS
Actions and scripting

Views

216

Translate

Translate

Report

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
Adobe
Community Expert ,
Dec 21, 2020 Dec 21, 2020

Copy link to clipboard

Copied

Doesn’t simply moving the Layerset itself work? 

You may have to link all LayerMasks before, though. 

Votes

Translate

Translate

Report

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
LEGEND ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

LATEST

If the layerSet does not exist yet you may select layer(Set)s to move and use this code:

 

sTT = stringIDToTypeID, nme = 'Main_Group';

(ref1 = new ActionReference()).putClass(sTT('layerSection'));
(dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref1);
(ref2=new ActionReference()).putEnumerated(sTT('layer'),sTT('ordinal'),sTT('targetEnum'))
dsc1.putReference(sTT('from'),ref2);(dsc2=new ActionDescriptor()).putString(sTT('name'),nme)
dsc1.putObject(sTT('using'), sTT('layerSection'), dsc2), executeAction(sTT('make'), dsc1)

 

Votes

Translate

Translate

Report

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