🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #711

Passing text to a JavaScript

#711
From: Malcolm Wooden
Date: Tue, 17 Mar 2009 14:41
34 lines
1617 bytes
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;
}
Technical Details
Message-ID: <59b83b74.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,a1f0ac98ff609245,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Malcolm Wooden" <mwooden@dtptypes.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Passing text to a JavaScript
Message-ID: <59b83b74.-1@webcrossing.la2eafNXanI>
Date: Tue, 17 Mar 2009 07:41:04 -0700
Lines: 36
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit