Article View: adobe.scripting.indesign
Article #1435Paragraphs2txtFrames script trouble
From: David_Milson
Date: Sun, 08 Feb 2009 17:43
Date: Sun, 08 Feb 2009 17:43
18 lines
1506 bytes
1506 bytes
Hi,
I've tried to adapt Peter Kahrel's script "footnotes2txtframes" from his excellent book on INDESIGN for my own problem.
From a long list of figures (separated by paragraph returns) in a single story, I want to move each paragraph into a separate textframe.
Later, I use these frames as captions for images in the book.
Here is my adaptation:
function paragraphs2textframes()
{
var myDoc = app.activeDocument;
// process all
for( var i = 0; i < myDoc.stories[0].paragraphs.length; i++ ) { // get reference to paras in a story var myParagraphs = myDoc.stories[0].paragraphs[i].contents; for( var j = 0; j < myParagraphs.length; j++ ) { // create new text frame for each and label each frame myTframe = myDoc.textFrames.add( { label : 'temp' + String(i)+String(j) } ); // move paragraph text to frame myParagraphs[j].texts[0].move( LocationOptions.after, Story); } } } paragraphs2textframes()
Please help.
Many thanks.
David
INDESIGN CS3; XP; 4GB
Technical Details
Message-ID:
<59b7d1ec.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,bee3e029b7d5a97e,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: David_Milson@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Paragraphs2txtFrames script trouble Message-ID: <59b7d1ec.-1@webcrossing.la2eafNXanI> Date: Sun, 8 Feb 2009 09:43:22 -0800 Lines: 34 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit