Copy link to clipboard
Copied
Hey guys,
I just added a progress bar to a script following Marc Autret's great example. Having read several forum posts I have come to understand that it is not possible to close the palette window using the cross in the top-right corner.
Does anyone have an alternative solution to this problem, maybe a workaround or an idea on how at least pressing "esc" could work?
I'd be grateful for your help.
Thanks in advance and regards,
David
Copy link to clipboard
Copied
Can you confirm the version of InDesign and the operating system you are using?
It would be great if you could describe exactly what you are trying to achieve.
Copy link to clipboard
Copied
Hello, guys...
Since nothing new happened here, I want to update the thread posting same question...
I have a script which exports indd to pdf after some changes during a for loop. Each increment in loop generates a new pdf file. This could be 5 files, or 4000. So, I want to be able to cancel during the procedure withou needing to stop InDesign via task manager. I'm on Windows. InDesign CC2020.
This is my snippet:
//PROGRESS
//============
var found = new Array (150);
var myProgress = new Window ("palette" , "Script by LFCorullón" , undefined , {closeButton: false});
myProgress.pbar = myProgress.add("progressbar", undefined, 0, found.length);
myProgress.pbar.preferredSize.width = 300;
myProgress.str = myProgress.add("statictext" , [0,0,300,24]);
myProgress.str.text = "Start processing...";
var btn = myProgress.add("group");
btn.alignment = "center";
btn.add("statictext" , undefined , "Press ESC to cancel");
myProgress.show();
//============
for (var i = 0; i < found.length; i++){
myProgress.pbar.value = i+1;
myProgress.str.text = "Processing " + (i+1);
$.sleep(20);
}
//============
//PROGRESS
Thanks for any suggestion.