Article View: adobe.scripting.indesign
Article #9418Re: Splitting multi-column text frame (CS and/or CS2)
From: Rodney_Sauer
Date: Fri, 18 Aug 2006 20:49
Date: Fri, 18 Aug 2006 20:49
32 lines
2348 bytes
2348 bytes
If you're a beginning scripter, it's usually much easier to modify something that already works than to come up with a script from scratch. Here is an AppleScript whose job is to split a frame below the insertion point into linked frames. By modifying it to count the number of columns and the gutter width, it should be possible to rewrite this to do your column-splitting task. You'll want to open the InDesign dictionary in the script editor to see what the names of the various properties are.
tell application "Adobe InDesign CS2"
set mySelection to item 1 of selection
set myFrames to parent text frames of item 1 of selection
set myFrame to item 1 of myFrames
set myStory to parent story of item 1 of mySelection
set mypage to parent of myFrame
set TextBaseline to baseline of mySelection
set OriginalBounds to geometric bounds of myFrame
set OriginalTop to item 1 of OriginalBounds
set OriginalLeft to item 2 of OriginalBounds
set OriginalBottom to item 3 of OriginalBounds
set OriginalRight to item 4 of OriginalBounds
set geometric bounds of object reference of myFrame to {TextBaseline, OriginalLeft, OriginalBottom, OriginalRight}
tell mypage
set NewFrame to make text frame with properties {geometric bounds:{OriginalTop, OriginalLeft, TextBaseline, OriginalRight}}
end tell
if myFrame is text frame 1 of myStory then
set properties of myFrame to {previous text frame:NewFrame}
else
set PreviousFrame to previous text frame of myFrame
set next text frame of PreviousFrame to NewFrame
end if
set selection to insertion point 1 of myFrame
tell text frame preferences of myFrame
set first baseline offset to leading offset
end tell
end tell
Rodney
Technical Details
Message-ID:
<3bc14acb.4@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc14acb.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,342a15e75fe733c1 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Rodney_Sauer@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: Splitting multi-column text frame (CS and/or CS2) Message-ID: <3bc14acb.4@webcrossing.la2eafNXanI> Date: Fri, 18 Aug 2006 13:49:35 -0700 References: <3bc14acb.-1@webcrossing.la2eafNXanI> Lines: 40 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing