Skip to main content
Vazhga_Valamudan
Participant
September 11, 2014
Question

hi i am new to java scripting please help him

  • September 11, 2014
  • 3 replies
  • 246 views

var para = app.activedocument.paragraphStyles.everyItem().getElements();

alert(para.length);

for(i=0; i<para.length; i++)

{

  alert (para)

  }

it is not run......

it is right or wrong coding?

This topic has been closed for replies.

3 replies

harish9003
Participant
September 11, 2014

Try this,

var para = app.activeDocument.paragraphStyles.everyItem().getElements();

alert(para.length);

for(i=0; i<para.length; i++)

{

  alert (para.name)

  }

Jongware
Community Expert
Community Expert
September 11, 2014

Vazhga Valamudan wrote:

[..]

it is not run......

it is right or wrong coding?

It is wrong, and you did not have to ask "if" it is, or even what is wrong because InDesign tells you:

If you change 'activedocument' to 'activeDocument', the script will run without errors.

Legend
September 11, 2014

for (var i = 0; i < app.activeDocument.paragraphStyles.length)

{

alert(app.activeDocument.paragraphStyles.name)

}

vandy