Skip to main content
PasGlop
Inspiring
November 6, 2017
Question

app.thermometer / Progress bar

  • November 6, 2017
  • 3 replies
  • 1672 views

Dear all,

I'm looking for a script to enable the display of the (animated) progress bar during the execution of any kind of script.

I tried various combinations with this code found on the forum, without success :

var tObj = app.thermometer;
tObj.duration = 1000000;
tObj.begin();
tObj.value=i;

for(var i=0;i<100000;i++)
{ tObj.text = "Processing, please wait";}

tObj.end();

I only succeded to display the progress bar window, but... without animation during the process of the function.

Would anyone have an idea how to combine this code with the execution of a function in order to see the animated progress bar during the execution of that function?

Thank you in advance and best regards.

This topic has been closed for replies.

3 replies

Legend
November 8, 2017

You can update the thermometer by adding extra lines inside your 500 line script, as often and as many as you want.

PasGlop
PasGlopAuthor
Inspiring
November 8, 2017

I am perplexed because I still have not understood how to make the thermother appear in a relevant way.
Let's imagine the following example:
I have a script of 500 lines that process one by one some fields of a document (some pass to hidden, some to visible, and others to readonly.
how should I write and place the thermometer so that the progress bar progresses as the fields are processed?

try67
Community Expert
Community Expert
November 8, 2017

Do you have a loop that iterates over those fields? If so, initiate the thermometer before the loop starts, change its value and/or text inside the loop, and end it after the loop finishes. If you want more exact instructions you will need to post your actual code.

PasGlop
PasGlopAuthor
Inspiring
November 8, 2017

Some of my scripts contain a loop, some not.

I will soon post examples, as you suggest.

Bernd Alheit
Community Expert
Community Expert
November 6, 2017

Try this:

var tObj = app.thermometer;

tObj.duration = 1000000;

tObj.begin();

for(var i=0;i<100000;i++)

{

tObj.value=i;

tObj.text = "Processing, please wait";

}

tObj.end();

PasGlop
PasGlopAuthor
Inspiring
November 6, 2017

Thanks for your messaqe.

I inserted my script just before "tObj.end()" (is it correct ?)

Now, I can see the progress bar moving... but, only before the process of my script.

When the chronometer stops (and so do the progress bar), my script starts but the progress bar is not progressing anymore during the execution of my script.

Is there a way to do it differently ?

Bernd Alheit
Community Expert
Community Expert
November 6, 2017

You must change the value of tObj in your script.