🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #765

extract items from a frame

#765
From: Ola_Khrapatin
Date: Mon, 02 Mar 2009 16:34
18 lines
1603 bytes
Hi there,

I got a long document which has many pages with the following structure:
a text frame,within it has another frame, and this later frame contains text frames and objects. In other words: a frame inside a frame inside a frame.

I need to write a script which would extract all of the inner frames, and paste them on the exact same coordinates, but as independant frames.

So I wrote the following code:

myStories = app.activeDocument.stories;
for (i=0; i<myStories.length; i++) { 	myStory = myStories[i]; 	myFrames = myStory.textFrames; 	for (j=0; j<myFrames.length; j++) 	{ 		myFrame = myFrames[j]; 		coord = [myFrame.geometricBounds[0], myFrame.geometricBounds[1]]; 		myFrame.select(); 		app.cut(); 		app.paste(coord); 	} }

Now, it seemed very nice in theory, but produces an error when running. The problem seems to be that InDesign think a story of a single text frame has "1 text frames", and a story of more that 1 text frames, has "0 text frames". (This is per the data browser.)

Please advise how can I solve this Issue.

Thank you,
Ola
Technical Details
Message-ID: <59b81716.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,50e6c9aacf044ae5,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Ola_Khrapatin@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: extract items from a frame
Message-ID: <59b81716.-1@webcrossing.la2eafNXanI>
Date: Mon, 2 Mar 2009 08:34:25 -0800
Lines: 38
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit