Copy link to clipboard
Copied
Dear Pros.
How to Make Progressbar Palette to be Canceled when the user hit Cancel Button to Stop Script Execution?
Here is my Example of ProgressBar
//Creating ProgressBar
var myProgressPanel,
myMaximumValue = 300,
myProgressBarWidth = 300;
myCreateProgressPanel(myMaximumValue, myProgressBarWidth);
function myCreateProgressPanel(myMaximumValue, myProgressBarWidth) {
myProgressPanel = new Window ('palette');
myProgressPanel.text = "Exporting PDF Files";
with (myProgressPanel) {
myProgressPanel.myProgressBar = add("Progressbar", [12,12, myProgressBarWidth,24], 0,myMaximumValue);
}
return myProgressPanel;
}
myProgressPanel = myCreateProgressPanel (100, 400);
myProgressPanel.show();
//End Creating ProgressBar
Thanks for any Help
Best Regards
Mohamamd
myProgressPanel.destroy()
When you call it depends on the control flow of your script. You could have an onClick event for your cancel button, or a returned result from show. You can also use myProgressPanel.close() to hide the progress panel while keeping it in memory.
Highly recommend Peter Kahrel's ScriptUI book, available for free here: https://creativepro.com/files/kahrel/indesign/scriptui.html
Copy link to clipboard
Copied
myProgressPanel.destroy()
When you call it depends on the control flow of your script. You could have an onClick event for your cancel button, or a returned result from show. You can also use myProgressPanel.close() to hide the progress panel while keeping it in memory.
Highly recommend Peter Kahrel's ScriptUI book, available for free here: https://creativepro.com/files/kahrel/indesign/scriptui.html
Copy link to clipboard
Copied
Thank you very much indeed
Best Regards
Mohammad