Hi,
I need to select timeline so my script can run.
If something else is selected, my script doesn't work.
I've tried to put onChange function with variables into onClick function but it doesn't work.
var myWin = new Window("palette","",undefined); var dropAlign = myWin.add("dropdownlist",undefined, ["Left","Center","Right"]); dropAlign.selection = 0; var btn = myWin.add("button",undefined, "OK"); var curItemHeight = app.project.activeItem.height; var myHeight = curItemHeight; dropAlign.onChange = function () { if (this.selection.index ==0){ myHeight = curItemHeight; } if (this.selection.index ==1){ myHeight = curItemHeight/2; } if (this.selection.index ==2){ myHeight = curItemHeight/20; } } btn.onClick = function (){ alert(myHeight); } myWin.center(); myWin.show();
Thanks