Article View: adobe.scripting.indesign
Article #9056Re: Putting all the elements from one page into another page
From: thechrisproject
Date: Thu, 14 Sep 2006 15:51
Date: Thu, 14 Sep 2006 15:51
16 lines
1966 bytes
1966 bytes
Olav,
I will try that, but my curiosity and desire to have a good handle on what I'm doing demand that I figure out why my way wasn't working. I found that part of the problem was that I was using page.pageItems rather than page.allPageItems. Can anyone tell me what the difference between the two is? The scripting reference is no good at explaing stuff like that.
So now I have this loop:
while(sourcePage.allPageItems.length > 0)
{
$.writeln(sourcePage.allPageItems.length);
var item = sourcePage.allPageItems[0];
var xOffset = item.geometricBounds[1];
var yOffset = item.geometricBounds[0];
item.move(destinationPage);
item.move([xOffset, yOffset]);
}
This seems to work pretty well, but for some reason it only works for one of my source pages. I'm running two through it right now. The first one has 5 page items, and they all change pages and get moved alright. The second one has three pageItems. The first item drops off the page's allPageItems after the first move (to a different page), but then reappears when I execute the next move command (changing the offsets). This make no sense to me, especially since it's not happening for the first document.
Technical Details
Message-ID:
<3bc17bef.10@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!217.73.144.44.MISMATCH!ecngs!feeder.ecngs.de!news.germany.com!news.isoc.lu!webcrossingReferences:
<3bc17bef.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,148c206390c52d9f X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: thechrisproject@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!217.73.144.44.MISMATCH!ecngs!feeder.ecngs.de!news.germany.com!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Putting all the elements from one page into another page Message-ID: <3bc17bef.10@webcrossing.la2eafNXanI> Date: Thu, 14 Sep 2006 08:51:57 -0700 References: <3bc17bef.-1@webcrossing.la2eafNXanI> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit