Article View: adobe.scripting.indesign
Article #19202Re: Best way to create new pages during xml import?
From: Dave Saunders
Date: Fri, 10 Jan 2003 16:40
Date: Fri, 10 Jan 2003 16:40
34 lines
2217 bytes
2217 bytes
AppleScript or VB?
In AppleScript, I just did the following. In my case, I use the insertion point as a way of telling my scripts what to work on. So, although you don't need to use selections, I do.
-- this script adds a page and flows the current text flow into a frame on it.
on run
tell application "InDesign 2.0.2"
set myStory to parent story of selection
set myFrame to parent text frame of selection
set myStart to index of insertion point 1 of selection
set myPage to name of page 1 of active spread of active window
tell document 1
set myMaster to object reference of master spread "C-Lesson Page tall"
set myNewPage to make page with properties {applied master:myMaster}
end tell
set active spread of active window to parent of myNewPage
set myBounds to bounds of myNewPage
set myMargPrefs to margin preferences of myNewPage
set item 1 of myBounds to (item 1 of myBounds) + (margin top of myMargPrefs)
set item 2 of myBounds to (item 2 of myBounds) + (margin left of myMargPrefs)
set item 3 of myBounds to (item 3 of myBounds) - (margin bottom of myMargPrefs)
set item 4 of myBounds to (item 4 of myBounds) - (margin right of myMargPrefs)
tell myNewPage
set myNewFrame to make text frame with properties {visible bounds:myBounds}
end tell
set next text frame of myFrame to myNewFrame
end tell
end run
This is for a document that uses single-page spreads and has a master with the specific name I used.
Hope this helps.
Dave
Technical Details
Message-ID:
<1de7523a.0@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de7523a.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,ecc1e32da8567f47 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-01-10 09:08:49 PST From: "Dave Saunders" <daves@pdsassoc.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Best way to create new pages during xml import? Message-ID: <1de7523a.0@WebX.la2eafNXanI> Date: Fri, 10 Jan 2003 08:40:24 -0800 References: <1de7523a.-1@WebX.la2eafNXanI> Lines: 44 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit