Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions applyPreset Method Not finding Path

  • applyPreset Method Not finding Path

    Posted by Sean Franklin on October 26, 2015 at 6:17 pm

    Hi all,

    I’m writing a script where I’ll need to apply an animation preset to a group of layers. I have the exact path pasted into a path variable, and I believe everything else is correct, but it’s still saying “unable to call applyPreset” because of parameter 1.

    Any ideas on why this is not working?
    Also, is there a way to get script error messages on a bigger window somewhere other than just the info panel on the bottom of extend script?

    Below is part of the code.

    Thanks!
    -Tim

    app.beginUndoGroup("Undo");

    var proj = app.project;

    var myLayers = app.project.items.layers;
    var items = app.project.items;
    var myComp, myLayer, myTime, myName;
    var presetPath = "C:\Program Files\Adobe\Adobe After Effects CC 2015\Support Files\Presets\Backgrounds\Apparition.ffx";
    var myPreset = File(presetPath);

    function creation(name,number,time,duration){

    this.name= name;
    this.number = number;
    this.time=time;
    this.duration = duration;

    //myName = name.toString;
    myComp = items.addComp(name, 1920,1080,1,duration,29.976);
    i = 0;
    var width = myComp.width;
    var height = myComp.height;
    var aspect = myComp.pixelAspect;
    var duration = duration-time;
    var myLayer = myComp.layers.addSolid([0,0,0],name,width,height,aspect,duration);
    myLayer.applyPreset(myPreset);

    };

    creation("Begin",6,15,300);

    Tim Franklin
    Watchout System Programmer/Compositor – CBS Sports
    Freelance Visual Effects Artist/ Video Editor
    http://www.TimSFranklin.com

    Sean Franklin replied 10 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 26, 2015 at 6:22 pm

    Try specifying your path this way:

    “/C/Program Files/Adobe/Adobe After Effects CC 2015/Support Files/Presets/Backgrounds/Apparition.ffx”

    Dan

  • Sean Franklin

    October 26, 2015 at 6:30 pm

    Phew, I thought I was going crazy. Thanks so much for the quick reply on this, works perfectly!

    Tim Franklin
    Watchout System Programmer/Compositor – CBS Sports
    Freelance Visual Effects Artist/ Video Editor
    http://www.TimSFranklin.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy