Skip to main content
Inspiring
January 10, 2011
Question

How to add a Progress Bar

  • January 10, 2011
  • 3 replies
  • 10290 views

Hi All,

How to add progress bar in script. I have gone through with forums but couldn't find any simple example.

Could anybody please show me a simple js code with progress bar in indesing script.

Thanks in advance for your support.

Mon.

This topic has been closed for replies.

3 replies

milligramme
Inspiring
January 11, 2011

I have refered  these sample scripts

http://www.adobe.com/products/indesign/scripting/

choose

> Scripting Resources > InDesign CS5 in-depth scripting guides

and download

Download the InDesign Scripting Guide scripts (ZIP, 832k )


unzip it, if javascript, progressbar sample is here

indesign_cs5_scripting_guide_scripts

├── javascript

│   ├── userinterfaces
│   │   └── progressbar
│   │       ├── CallProgressBar.jsx
│   │       └── ProgressBar.jsx

you can also download other fuction scripts

mg

Inspiring
January 11, 2011

Thanks you all for your answer.

I have gone through with your suggestion. But it seems not easy for me.

Could you please help me to add the progress bar in below simple script.

Thanks,

Mon

Here is my script code.

var myFilePath = Folder.selectDialog("Please choose files:");

myFilePath = new Folder (myFilePath);

myFilePathContents = new Array();

mySubFolders(myFilePath);

var myDocument = app.documents[0];

for (var j = 0; myFilePathContents.length > j; j++) {

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

var myDocument = app.open(myFilePathContents);

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

//

myDocument.viewPreferences.horizontalMeasurementUnits =MeasurementUnits.millimeters;

myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters;

app.activeDocument.close(SaveOptions.yes);

//

}

function mySubFolders(theFolder) {

var myFileList = theFolder.getFiles();

for (var i = 0; i < myFileList.length; i++) {

var myFile = myFileList;

if (myFile instanceof Folder){

mySubFolders(myFile);

}

else if (myFile instanceof File && myFile.name.match(/\.indd$/i)) {

myFilePathContents.push(myFile);

}

}

}

alert("Done.")

Inspiring
November 23, 2012

Please help me out to add the progress bar in this script.

Thanks in advance,

Mon

Inspiring
January 10, 2011

http://forums.adobe.com/search.jspa?communityID=3331&resultTypes=MESSAGE&q=progress+bar

(Or did you mean that none of the answers you found are easy?)

Peter Kahrel
Community Expert
Community Expert
January 10, 2011

It's described in this guide: http://www.kahrel.plus.com/indesign/scriptui.html

But it may not be that easy.

Peter