Apply preset and strange result

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Simma
Posts: 98
Joined: June 8th, 2010, 2:57 pm

I'm probably missing something obvious here but if I run the attached code without a layer selected, a new solid is created and the preset is applied to that layer. If I select the first layer it works as expected.

Code: Select all

var path = "D:/vfx_tools/aftereffects_tools/animation_presets/jpegEdgeFix.ffx"

var myLayer = app.project.item(1).layer(1);

var preset = new File (path)

var addPreset = myLayer.applyPreset(preset);
Simma
Posts: 98
Joined: June 8th, 2010, 2:57 pm

Looks like the layer needs to be selected (myLayer.selected = true). Weird.
everydayme
Posts: 4
Joined: August 13th, 2008, 9:33 pm

Awesome, helped me out!

My script was looping through all selected layers and supposed to apply a preset according to layer name, but would only apply to the first one. Select fixed it!


Thanks.
Post Reply