Article View: adobe.scripting.indesign
Article #17481Re: Copying pages of table flow
From: Jay Fraser
Date: Thu, 05 Jun 2003 22:44
Date: Thu, 05 Jun 2003 22:44
57 lines
2803 bytes
2803 bytes
OK, I give up...
I got this far:
set thePath to (path to startup disk as string)
tell application "InDesign 2.0.2"
set myDocument to active document
tell myDocument
set mySelection to selection
if (count of items of mySelection) is not equal to 1 then
activate
display dialog "Please select 1 (and only 1) text frame." buttons {"Cancel"} default button 1
end if
if class of item 1 of mySelection is not text frame then
activate
display dialog "Please select text frame using" & return & "Selection Tool (Black Arrow)." buttons {"Cancel"} default button 1
end if
set myTextFrame to item 1 of selection
set myStory to object reference of parent story of myTextFrame
set myFrameCount to (count of text frames in myStory)
end tell
repeat with i from myFrameCount to 1 by -1
tell myDocument
set myCurrentFrame to text frame i in myStory
set myCurrentPage to parent of myCurrentFrame
set myGeoBounds to geometric bounds of myCurrentFrame
set myPageNumber to name of myCurrentPage
set myCurrentStuff to contents of object reference of myCurrentFrame
end tell
set myNewDocument to make document
tell myNewDocument
tell page 1
set myNewFrame to make text frame with properties {geometric bounds:myGeoBounds}
set contents of myNewFrame to myCurrentStuff
end tell
end tell
set myNewDocName to "Table_Page" & myPageNumber & ".indd"
save myNewDocument to (thePath & myNewDocName)
end repeat
end tell
This works OK with flowed text, but it removes all styling from the text. It doesn't work at all w/ tables. I've tried a bunch of different combinations in the set myCurrentStuff and set myNewFrame lines, but just can't get it to work.
help?
Technical Details
Message-ID:
<1de96b83.4@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!skynet.be!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de96b83.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,590814201803d300 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-05 16:08:32 PST From: "Jay Fraser" <jayfraser@yahoo.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!skynet.be!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Copying pages of table flow Message-ID: <1de96b83.4@WebX.la2eafNXanI> Date: Thu, 5 Jun 2003 15:44:17 -0700 References: <1de96b83.-1@WebX.la2eafNXanI> Lines: 60 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit