• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Cancel a progress bar

New Here ,
Aug 01, 2018 Aug 01, 2018

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

TOPICS
Scripting

Views

525

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 13, 2019 Nov 13, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 30, 2020 Mar 30, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines