Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

Explorer ,
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

86

Likes

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 Professional ,
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. 

Likes

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 Professional ,
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)

 

Likes

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