ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

My script makes AE crash when using script UI

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Romain Charles
My script makes AE crash when using script UI
on Jul 19, 2018 at 11:10:32 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 ?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]