0

I need help writing a JavaScript that will search for the first instance of a paragraph style in each text box and then replace it with another paragraph style. If there's a way to do that with a grep, that'd be good too. Any ideas?

Thanks!

1 Answers1

0

Some work points you should face developing this

  • 1st all the script inherits the Application class.

  • get the page you are working on - class Page

  • Get all the pageItems - ItemPage or PageItem (I don't remember now)

  • Loop through pageItems and get all the textframes within the document - TextFrame Class

  • Using a loop get from all the textframes the first paragraph. something like

    pageItem[i].textFrame[i].paragraph[0]

    • Put the paragraph in a variable, use the documentation on the script and change the desired styles

A good reading reference for you

Jongware page

João Dias
  • 1,078
  • 1
  • 15
  • 38