Skip to main content
Participating Frequently
August 27, 2012
Answered

Delete folder Mask

  • August 27, 2012
  • 1 reply
  • 681 views

Hi,

I have a script that copy mask from folder to all children layers. But I have problem with delete mask from folder. Can you help me with this?? I try to use script listener but it do nothing on delete mask.

Thank you for your help

Domaneni

This topic has been closed for replies.
Correct answer c.pfaffenbichler

Are you sure you know what you are doing? (Applying a Layer Mask to a Group is not the same as applying the same Layer Mask to all contained Layers.)

Does this not work?

var id495 = charIDToTypeID( "Dlt " );

var desc95 = new ActionDescriptor();

var id496 = charIDToTypeID( "null" );

var ref66 = new ActionReference();

var id497 = charIDToTypeID( "Chnl" );

var id498 = charIDToTypeID( "Chnl" );

var id499 = charIDToTypeID( "Msk " );

ref66.putEnumerated( id497, id498, id499 );

desc95.putReference( id496, ref66 );

executeAction( id495, desc95, DialogModes.ALL );

1 reply

c.pfaffenbichler
Community Expert
c.pfaffenbichlerCommunity ExpertCorrect answer
Community Expert
August 27, 2012

Are you sure you know what you are doing? (Applying a Layer Mask to a Group is not the same as applying the same Layer Mask to all contained Layers.)

Does this not work?

var id495 = charIDToTypeID( "Dlt " );

var desc95 = new ActionDescriptor();

var id496 = charIDToTypeID( "null" );

var ref66 = new ActionReference();

var id497 = charIDToTypeID( "Chnl" );

var id498 = charIDToTypeID( "Chnl" );

var id499 = charIDToTypeID( "Msk " );

ref66.putEnumerated( id497, id498, id499 );

desc95.putReference( id496, ref66 );

executeAction( id495, desc95, DialogModes.ALL );

DomaneniAuthor
Participating Frequently
August 27, 2012

It seems that not

But I know only two way how apply Group Mask to contained layers.

1. Merge Group with Mask to one layer

2. Copy Group Mask to contained layers and rasterized them individually.

Do you know some other way?? I need separated layers, not merged.

Domaneni

c.pfaffenbichler
Community Expert
Community Expert
August 27, 2012

I guess I missunderstood what you meant with

But I have problem with delete mask from folder.

Because the above code deletes Layer Masks from Groups just fine.

Action Manager code should be faster (more complicated, though), but it might be easier to use the DOM and load the Mask and apply it to all contained Layers with a for-clause.

What aboud Layers that already have a Layer Mask?