Skip to main content
Participant
October 13, 2010
Question

Exporting to filename from paragraph style

  • October 13, 2010
  • 1 reply
  • 1929 views

I have a 80 page indesign file.  I would like to export to single page pdfs, with filenames based off a paragraph style on each page.

Is this possible?  I have no background or experience with scripting.  Any help would be much appreciated.

Thanks

Derek

This topic has been closed for replies.

1 reply

October 14, 2010

Yes, it is posible, probably not even hard.

How exactly are the paragraph styles named or what rules do you have? Do you have 80 paragraph styles, one per page or how is it set up?

Participant
October 14, 2010

It is a recipe book, one recipe per page.  The recipe names are all a paragraph style "Recipe Name".  I want single page pdfs named the Recipe Name.

October 14, 2010

I see.

1. Loop the pages.

2. Search for text frames on each page.

3. See if it contains the paragraph style, im assuming its the first paragraph of that text frame.

4. Export the page using that name.

for(var p = 0; p < app.documents[0].pages.length; p++) {      var frames = app.documents[0].pages

.textFrames;      var page_name = null;      for(var i = 0; i < frames.length; i++) {           if(frames.paragraphs[0].appliedParagraphStyle.name == 'test') {                page_name = frames.paragraphs[0].contents;                break;           }      }      if(page_name != null) {           // Export page      } }