Article View: adobe.scripting.indesign
Article #15593Re: Dupe & Move Text?
From: Olav_Kvern
Date: Fri, 21 Nov 2003 22:18
Date: Fri, 21 Nov 2003 22:18
25 lines
1828 bytes
1828 bytes
Dave--
Why not replicate the text using properties? We've borrowed the "properties" concept from AppleScript for our JavaScript implementation. Here's an example:
//DupMoveText.js
//Create an example document.
var myDocument = app.documents.add();
myDocument.colors.add({name:"Red", colorValue:[0, 100, 100, 0]});
var myBounds = new Array;
myBounds[0] = myDocument.pages.item(0).marginPreferences.top;
myBounds[1] = myDocument.pages.item(0).marginPreferences.left;
myBounds[2] = myDocument.documentPreferences.pageHeight - myDocument.pages.item(0).marginPreferences.bottom;
myBounds[3] = myDocument.documentPreferences.pageWidth - myDocument.pages.item(0).marginPreferences.right;
myString = "1a\t1b\t1c\r\t\t\r\t\t"
var myTextFrame = myDocument.pages.item(0).textFrames.add(undefined, undefined, undefined, {geometricBounds:myBounds, contents:myString});
var myTable = myTextFrame.parentStory.tables.add();
var myString = myTable.cells.item(0).contents;
myTable.cells.item(0).texts.item(0).fillColor = "Red";
myTable.rows.item(1).cells.item(0).texts.item(0).properties = myTable.cells.item(0).texts.item(0).properties;
Thanks,
Ole
Technical Details
Message-ID:
<2cce85f9.0@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2cce85f9.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,6aa554de447ce921 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-11-21 14:38:09 PST From: Olav_Kvern@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: Dupe & Move Text? Message-ID: <2cce85f9.0@webx.la2eafNXanI> Date: Fri, 21 Nov 2003 14:18:34 -0800 References: <2cce85f9.-1@webx.la2eafNXanI> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit