Paragraphs2txtFrames script trouble
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
|