comet.progress

The comet.progress module provides functions showing a progress bar during script execution.

Methods

comet.progress.start(title='Progress', steps=24)

Show the progress bar.

When processing multiple scripts (panel actions for multiple selected document frames), a progress bar is automatically opened and closed at the end of batch processing.

The progress bar is automatically closed at the end of the script.

Parameters:
  • title (str) – The title of the progress bar window.

  • steps (int) – The number of divisions for the progress bar.

Return type:

None

Raises:

TypeError – When parameter types are invalid.

Available:

InDesign®

CScript:

progress::start

comet.progress.step(count=1, label='')

Increment the progress bar and optionally set a hint text.

The hint text is shown below the progress bar.

Parameters:
  • count (int) – How many steps to increase on the progress bar. When the value exceeds the maximum steps set by start(), it is set to the maximum value.

  • label (str) – The label to show under the progress bar.

Return type:

None

Raises:
  • TypeError – When parameter types are invalid.

  • ValueError – When parameter count is negative.

Available:

InDesign®

CScript:

progress::step

comet.progress.stop()

Stop and hide the progress bar.

Return type:

None

Available:

InDesign®

CScript:

progress::stop

comet.progress.unit(chapter, index=0)

Change the chapter caption for the progress bar.

If an index is defined, it will be attached to the chapter caption.

Parameters:
  • chapter (str) – The chapter caption.

  • index (int) – The chapter index.

Return type:

None

Available:

InDesign®

CScript:

progress::unit