当我在 ExtendScript Toolkit(目标应用程序 - After Effects CC 2015)中运行此代码时,取消按钮在进度条完成之前没有响应。
我想让它工作,以便取消按钮立即响应。
我知道按下“Esc”键会立即起作用,因此应该可以使取消按钮也起作用。
testWindow = new Window ("palette", "Processing:", undefined);
pb = testWindow.add("progressBar",undefined, 0);
cancelButton = testWindow.add("button", undefined, "Cancel");
testWindow.show();
cancelButton.onClick = function(){
alert("Cancel");
}
i = 1;
while (i <= 1000000) {
pb.value = Math.round(100*i/1000000);
testWindow.update();
i++
}