3 Replies Latest reply on Mar 18, 2009 4:28 AM by Harbs.

    Passing text to a JavaScript

      I ave a JavaScript that builds a 6 column page but I need to add variable text to it depending on how is using it. How do I pass a variable for the text to the script. My script looks like this so far.

      var myDocument = app.documents.add();
      with(myDocument.documentPreferences){
      pageHeight = "297mm";
      pageWidth = "210mm";
      pageOrientation = PageOrientation.portrait;
      facingPages = false;
      }
      with(myDocument.textDefaults){
      kerningMethod = "Metrics";
      appliedFont = "Arial";
      }
      with(myDocument.pages.item(0)){
      with(marginPreferences){
      columnCount = 6;
      columnGutter = "4.233mm";
      bottom = "12.7mm";
      left = "12.7mm";
      right = "12.7mm";
      top = "12.7mm";
      }
      with(textFrames.add()){
      geometricBounds = ["12.7mm", "12.7mm", "284.3mm", "197.3mm"];
      contents = "Text goes in here";
      with(textFramePreferences){
      textColumnCount = 6;
      }
      }
      }
      with(myDocument.viewPreferences){
      HorizontalMeasurementUnits = 205418890;
      VerticalMeasurementUnits = 205418890;
      }