Skip to main content
Cefalopodo
Inspiring
Feb 16, 2025 11:04 PM UTC
Answered

Using applyPreset on duplicated layer in Script

Hi. I'm having some strange behavior when I use applyPreset on a duplicated layer. I have a duplicated layer,  and I use applyPreset on it, but the preset is applied to the originial layer:

 

var originalLayer = app.project.activeItem.layers[1];
var duplicatedLayer = originalLayer.duplicate();

var presetFile = new File("the/path/to/my/preset");

duplicatedLayer.applyPreset(presetFile); //The preset is applied on originalLayer

 

Is this a normal behavior? If it is, is there a workarround?

Dan Ebberts
Dan EbbertsCorrect answer
Community Expert
Feb 17, 2025 1:09 AM UTC

You have to make sure that all layers other than your target layer are deselected. I usually deselect all layers in the comp, then select the target layer, then apply the preset.

2 replies

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
Feb 17, 2025 1:09 AM UTC

You have to make sure that all layers other than your target layer are deselected. I usually deselect all layers in the comp, then select the target layer, then apply the preset.

Translate
Cefalopodo
Inspiring
Feb 17, 2025 6:49 AM UTC

Thanks! It works

Translate