Article View: adobe.scripting.indesign
Article #18786Re: Moving Master Page Items (AS)
From: rob day
Date: Wed, 05 Mar 2003 13:54
Date: Wed, 05 Mar 2003 13:54
38 lines
2443 bytes
2443 bytes
Ole
I'm having trouble getting to the page items on the master pages themselves. This is what I tried:
tell application "InDesign 2.0.2"
tell document 1
set myDocPrefs to document preferences
set myPageH to page height of myDocPrefs
set myNewPageW to page width of myDocPrefs
repeat with myMP from 1 to count of every master spread
repeat with x from 1 to count of every page item of master spread myMP
--I get an error here
set itemBounds to geometric bounds of page item x of myMP
set myTop to item 1 of itemBounds
set myLeft to item 2 of itemBounds
set myBot to item 3 of itemBounds
set myRight to item 4 of itemBounds
--this expands the gutter items and has to happen before everything is moved
if (item 4 of itemBounds is less than myNewPageW + 0.1) and (item 4 of itemBounds is greater than myNewPageW - 0.1) then
set geometric bounds of page item x to {myTop, myLeft, myBot, myNewPageW + 0.25}
end if
if (item 2 of itemBounds is greater than myNewPageW - 0.1) and (item 2 of itemBounds is less than myNewPageW + 0.1) then
set geometric bounds of page item x to {myTop, myNewPageW - 0.25, myBot, myRight}
end if
--this moves everything. Using the move command rather than bounds includes the pictures
if item 4 of itemBounds is less than myNewPageW + 0.1 then
move page item x by {-0.25, 0}
end if
if item 2 of itemBounds is greater than myNewPageW - 0.1 then
move page item x by {0.25, 0}
end if
end repeat
end repeat
end tell
end tell
Thanks for your help,
Rob
Technical Details
Message-ID:
<1de81833.8@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!easynet-quince!easynet.net!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de81833.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,7331c35b4209206f X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-03-05 06:07:44 PST From: "rob day" <vevans@mediaone.net> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!easynet-quince!easynet.net!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Moving Master Page Items (AS) Message-ID: <1de81833.8@WebX.la2eafNXanI> Date: Wed, 5 Mar 2003 05:54:15 -0800 References: <1de81833.-1@WebX.la2eafNXanI> Lines: 46 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit