Script to Map Paragraph Style Sheets

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Script to Map Paragraph Style Sheets

Viewing 4 reply threads
  • Author
    Posts
    • #109828
      Vatrice Chestnut
      Participant

      I have completed the InDesign layout for a study guide. It includes instructional content, practice questions and answers. From the guide file, I need to create two additional InDesign files—one for practice questions and one for an answer key.

      Is there a script I can use to map the paragraph style sheets from the study guide document to the practice test document? And then a script to map the paragraph style sheets from the study guide document to the answer key document?

      There might be a third option I haven’t considered so I am open to hearing it. I need to automate this process as much as possible to reduce production costs.

    • #110095

      I’m not sure what you mean, Vatrice. I know it’s been a while since you posted, but if you’re still looking for help, could you explain a bit more? Why do you need to map styles, why not just do a Save As and create your second and third files so that the styles come along? Or create your new files and choose Load All Styles from the Paragraph Styles panel menu to import them?

      AM

    • #110112
      Vatrice Chestnut
      Participant

      Hi Anne-Marie,
      I am working on a practice test document. The template is an eBook. The original file is the print version.

      To start my process, I import the styles from the template into the eBook file. Then I copy and paste the text from the print version into the eBook template. After doing so, I still have to manually apply paragraph styles to the content.

      I thought I might have a better outcome if I mapped the print version paragraph and character styles to the eBook template paragraph and character styles.

      Thanks for your help,

    • #114613

      //DESCRIPTION: List paragraph styles in their style
      (function() {
      if (app.documents.length > 0) {
      processDocument(app.documents[0]);
      }
      function processDocument(aDoc) {
      var page = aDoc.pages[0];
      var bounds = page.bounds;
      var theTF = page.textFrames.add({geometricBounds: bounds});
      var theStory = theTF.parentStory;
      theTF.move(undefined, [bounds[1] – bounds[3], 0]);
      var paraStyles = aDoc.allParagraphStyles.sort();
      for (var j = 0; paraStyles.length > j; j++) {
      theStory.insertionPoints[-1].contents = paraStyles[j].name;
      theStory.paragraphs[-1].appliedParagraphStyle = paraStyles[j];
      theStory.insertionPoints[-1].contents = “\r”;
      }
      }
      }())

    • #114614

      go to a first page of document and run script.
      A list apears on pasteboard.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
>