Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions My script makes AE crash when using script UI

  • My script makes AE crash when using script UI

    Posted by Romain Charles on July 19, 2018 at 11:10 am

    This is my script:

    p = app.project.activeItem;

    var w = new Window ("palette");
    w.alignChildren = "fill";
    // Paramétrage symétrique
    var p4 = w.add ("panel");
    p4.alignChildren = "fill";
    p4.add ("statictext", undefined, "Etape 4");
    var btn6 = p4.add ("button", undefined, "Paramétrer symétriquement", {name:"OK"});
    btn6.onClick = function(){keyCloner();}

    w.show ( );

    function keyCloner(){
    selLayers = p.selectedLayers;
    for(w in selLayers){
    selProps = selLayers[w].selectedProperties;
    for(x in selProps){
    if(selProps[x].propertyDepth == 3){
    if(selProps[x].keyValue(2) == selProps[x].keyValue(3)){
    alert(selProps[x].matchName);
    }
    else{
    alert(selProps[x].matchName);
    }
    exit;
    }
    }
    }
    }

    When using it like this, it crashes.
    When removing the script UI, and calling the function with

    keyCloner();

    it works.

    I think the problem is with

    function(){keyCloner();}

    but I don’t understand why. Does someone have an idea ?

    Romain Charles replied 7 years, 10 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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