Copy pages between documents

Hello there,
I'm trying to compile a final .indd file based on different documents pages. To do that, i'm loading a XML file with the names of the files I need and the page I need .
exemple of my XML:
<files>
     <file url="firstDoc.indd" page="2" />
      <file url="secDoc.indd" page="5" />
     <file url="thirdDoc.indd" page="1" />
</files>
There is no probleme to load that XML and parse it. I can open the file and get the right page, but I don't know how can I copy these pages in a single new document.
Is there any copy function ? or move function ? that can do that easily ?
I've got a function like that for now:
var myDocument = app.documents.add();
for(var i=0;i<(xml.file.length()-1);i++){
     var address = xml.file[i].attribute("url");
     var myMod = app.open(File(idFileFolder+"/" + address), false);
     var myPage = myMod.pages[xml.file[i].attribute("page")];
     myMod.close(SaveOptions.no);
If someone have an advice or a part of a script, I'll be really thankfull.
Cheers.
Gael

This should get you started:
if(app.documents.length < 2) {
    alert("Must have two open documents");
    exit();
var myDocOne = app.documents[0];
var myDocTwo = app.documents[1];
var myPage = myDocOne.pages[0];
myPage.duplicate(LocationOptions.AT_END, myDocTwo.pages.lastItem())

Similar Messages

  • Indesign CS6 crashes when copying pages between documents

    I have two documents and I want to copy 28 pages from one to the other. Indesign crashes on any form of attempt. What I tried so far:
    1. Copy pages per drag and drop, ID would then ask where to insert, I selected "at the end". Crash.
    2. Save both documents as IDML, then opened the IDMLs, saved as INDD (to erase possible document structure corruptions), closed and opened both INDDs again, then drag and drop. Crash.
    3. Selected the 28 pages from the source document, selected "Insert pages" from mini menu of pages panel, then set what pages to use, where to put ("At the end") and target (the other document). Crash
    4. Tried both, "Insert pages" and drag 'n drop, with different target position "At the beginning". Crash.
    5. Saved a copy of the source document, reduced it to contain only those 29 pages I want to copy, then drag and drop to target. Crash.
    6. Tried vice versa, means copy all target document's pages to the source document. Crash.
    Any idea how I can get the pages over to the target? There is unfortunately no "Append pages from file" in the mini menu.
    TIA!

    I would try another one with each of these documents.
    Create a new document with 2 pages.
    Name the master pages so, that their names are not conflicting with neither of these 2 document’s masters.
    Delete every style in that empty document, also any swatch
    No drag the pages of the first document into such an empty document.
    Do the same step 1 to 4 with the second document in a NEW empty document.
    Now you have 2 new documents. Take care that no conflicting master names appear.
    In each of these documents create in each style panel a folder and drag all used styles in that folder.
    Save both documents
    Try again to insert the pages of both documents.
    Otherwise, it this does not work out, could you send me via private message the files or a link. I would check it with a Debugging Version of InDesign (InDesign DEV) I can use to find errors.

  • Move or Copy pages between documents

    In the Adobe Help Menu it says... If you copy a page from a document that has a different size than the document you are copying to, it will be resized to the dimensions of the destination.
    I can not get this to work. Can copy from doc to doc, but ad size remains the same. Any help with this please.

    Yup, I think you're right Mr. Mike. I also think that they are trying to make "it" sound like they're making water into wine! Like I said, I'm just plumb frustrated w/trying to learn this program 2day. I'll do better 2morrow... I hope! Thanx all for your help.

  • How to move pages between documents WITHOUT elements shifting

    Hi everyone! My team members and I are so frustrated over what I think should be a really simple issue: copying/moving/dragging pages between documents and NOTHING CHANGING.
    Whenever we move pages between documents (which we have to do on a monthly basis - moving content into client branded files), at least ONE thing will shift and it usually has to do with overset text and/or text wrap. We have googled our brains out. We've tried everything on this list How-To: 10 Techniques for Copying Pages Between InDesign Documents | CreativePro.com and in the various Lynda tutorials we've looked at. We have combined our powers and still can not solve this problem so now I come to you, hoping that you can please please please help us figure out this issue before one of us throws a computer out the window.
    We have this one document. And this is what one of the problem pages looks like. Everything is on one layer. (look at the section marked 5)
    Then I move the pages (copy/paste the content; drag and drop the pages; etc.) into the destination document so we can apply branding.
    AND THIS HAPPENS.
    WHY does this text suddenly become overset?
    The preferences of both documents are IDENTICAL. In fact, Document B was originally created from Document A.
    AND FUN FYI: I took Document A and Saved As a new name. Opened it the new name. And tried moving the pages into the newly named document -- and the SAME EXACT THING HAPPENED.
    I am going to bash my head into a wall. Can someone please shed some light on this? Have you seen this before? How do we fix it??

    aschwartau wrote:
    Doesn't saving as IDML lose some of the properties if you use any shadow or other effects?
    That's not something that I have ever heard, but since I haven't heard everything, I suppose it's possible. What you may be thinking of is that some people use idml to migrate a file to a lower version, and if that lower version lacks a feature of the version that created the file, you will either lose or modify the way that that feature worked in the original. I don't think that even in that scenario that a feature that was present in both versions would go away just because it took a trip through idml to get to an earlier version. And if idml botched shadow or effects, nobody would use it, and I don't think Adobe would have it.
    aschwartau wrote:
    If we had just done a final Save As on the Document A before giving it to the team member who's going to be copying the content into Document B, does that not count as doing a Save As? You mean the minute it's freshly opened try doing another Save As? (P.S. Edit: Just tried this. Didn't change what happened. )
    The thing that Save-As does is remove little bits of data associated with undos that a normal Save retains. Sometimes this data can lead to problems, so any time you do it, it will help, but if you do it at stage 37 and you hand off at stage 38, you will have cleared out most all of anything that may have built up over time. I don't want to give the impression that it is required, but it certainly doesn't hurt, and is probably a good idea to Save-As periodically.

  • Reader XI, placing blank page between document pages?

    I have Adobe Reader XI, Version 11.0.2.  In the last two weeks one our agents readers started placing a blank page between document pages.  We have re-installed the product a couple time, reset standard defaults, and it is stil placing blank pages between document pages.  Any ideas to rectify the problems.  Every document he pulls up this happens.

    Can you give us a link to a document with these pages?
    Reader cannot insert pages into a PDF file so something must be up with the PDF's themselves.

  • Copy pages between Applications?

    Hello all
    please can someone tell me if it is possible to copy pages between applications in APEX 3.0 onwards?
    We are currently on APEX 2.0, where I don't think it is possible to copy pages from one application to another.
    Many thanks
    Paul

    Hello,
    >> I'm not sure, but is it not possible to simply export the page from one application and save it on ur computer, and then import it into another application?
    That will work only if the applications share the same workspace, However in this case, using the copy option, as Andy described, seems simpler.
    If you want to import the page into a different machine, the target application must reside on a workspace with the same ID as the source workspace (most likely, the target workspace was created by importing the source workspace.
    Regards,
    Arie.

  • Move pages between documents

    Hi!
    How can i move a page between two documents?

    Hi Adam,
    Lets say you want to replace page -2 in document -1 with page-2 from document 2.
    - Open Document -1 in Designer.
    - Without closing Document -1, open Document -2 in designer.
    - Goto designer view in document 2. Navigate to page-2. Right click > coly (Note: It will be copied as a subform).
    - Goto Document -1. Go to the hierarchy. Select Page-2. Delete.
    - In page-1 . Paste. The page-2 would be pasted as a subform.
    - Drag the subform in the hierarchy and rename as Page-2.
    Second option: If you want you can also use page-2 of document -2 as fragment and embed it in document-1
    Hope this helps.
    Thanks.
    Bibhu.

  • Copy pages between different applications

    Hello,
    I'm trying to copy a page from one application to another with Apex 1.6.
    In the first application I exported the page I want to copy and I've tried to import
    it in my second application. But I got the message that my file was not in the correct format...
    Is there any easy way to do it?
    Thanks.
    Sofie

    Sofie,
    No, there is no easy way to do it. There is a difficult way that has been cited many times in this forum (search for copy page): Synonyms
    Scott

  • Copying master pages between documents.

    I Am laying out a book with 36 chapters and I formatted my master page and completed Chapter One.  Chapter Two is a new document and I want to carry over Master-A to each successive one.  I believe there must be a way to do it, but nothing I have tried works.  I am using Windows 7 and InDesign 5.5, version 7.5.

    I created a new master page template and added my first chapter to it.  Everything except the chapter title from the master page footer appeared on the pages.  I went to the master pages and deleted the chapter title and then replaced it and reapplied the master to all pages.  The chapter title still did not come up on the document pages.

  • Move pages between documents keeping threads

    Hi all,
    This is my problem. I'm trying to move several pages from different spreads into another document. I´m trying it this way:
    doc2.pages.itemByRange(0, 2).duplicate(LocationOptions.AT_END,doc1);
    where doc1 and doc2 are my documents. This works fine but when i have threaded texts the threads are broken.
    I have tried to move spreads instead of pages this way:
    doc2.spreads.itemByRange(0, 2).duplicate(LocationOptions.AT_END,doc1);
    and now the threads between pages in the same spread aren´t broken, but the threads between pages in different spreads are.
    Does anybody know how to solve this problem?
    Thanks in advance.
    Alvaro

    Is that the way the menu option "Move Pages..." from the Pages panel works?
    There it seems to do what i want... do they rethread the text frames there too?
    Thanks Harbs.
    Alvaro

  • Copy pages between applications - error

    Hello !
    When I try to copy a certain page (using export / import) between two applications, I receive "File is not a valid HTML DB export file". I exported a page from an upgraded application and I tried to import it in a new application created from scratch using the new 1.6 environment (both the upgraded and the new application are in the same database and same workspace). What should I do ?
    Lucian

    export page from app ID A workspace W in database D
    import/install page into app ID A workspace W
    in database D-prime is supported.
    No other combinations are.
    (D may equal D-prime)
    The "same workspace" means the ID is the same. If it
    isn't, it's not the same workspace, so what I
    described may not be exactly what you are doing,
    regardless of how closely I read your description.This is not making sense to me
    1. By workspace id you mean the system generated id 62181533721 or some such? I have no control over that!
    If so, in your first paragraph above, if database D is the same as database D-prime, that would be like exporting a page and importing it right back (thus blowing the existing page away). The only situation I see this useful for is backup a page, work on it for a few days, realize a major goof up and "restore" from your backup.
    Thats fine, but thats not what I am asking about.
    I am asking about a systematic "deployment" of HTMLDB pages from a dev environment to a QA/UAT env to a Production environment.
    Given this and since the internal workspace id in each of these environments will be different, are you saying that there is no way to do what I am asking?
    Then, how the heck do people use HTMLDB in a traditional IT environment with Dev, QA/UAT, Production!
    Sorry if I misunderstood anything, but please clarify this for me
    Thanks

  • Copy prices between documents assigned to different pricing procedures

    Different pricing procedures are assigned to sales document & Billing document -- however some of the condition types are common in the two procedures-- would the pricing get copied for the those common conditions if the copy control is set to copy (pricing type "G")
    Appreciate your responses.

    Pricing Type = G is to copy the pricing and redetermine taxes so it should based on if that is all in the copy control. We do not have a different pricing procedure for both, we just copy the values from the order and/or the freight document.
    When I have these types of questions, I always run a test order in dev and it answers many questions. Good Luck.

  • How to copy swatches between documents?

    Hi,
    I've been trying for a while to copy all swatches from a document to another. The goal is to create a new document with the same swatches as a source document.
    The most obvious solution to this, would be to use the duplicate command, but I can't seem to get it working properly. Something similar to the following line produces the error "clone not allowed":
    duplicate swatch 1 from doc1 to doc2
    I've have also tried this variant:
    repeat with i from 1 to count of doc1's swatches
         set swatchProperties to properties of swatch i of doc1
         set swatchProperties's container to doc2
         make new swatch in doc2 with properties sProp
    end repeat
    This oddly enough works in the first iteration, but then spits out the error: "Adobe Illustrator got an error: Invalid type".
    I thought this would be an easy task, and I still believe it somehow is and I'm just doing it wrong.
    Anyone?
    Thanks

    OK,
    Now I actually managed to do it:
    repeat with i from 1 to count of doc1's swatches
         set newSwatch to make new swatch in doc2
         set newSwatch's name to (name of swatch i of doc1) as string
         set newSwatch's color to color of swatch i of doc1
    end repeat
    It would it still be nice though if someone could tell me how to use the duplicate command.
    Thanks

  • Transfer a page between documents

    I'm working on two seperate documents and need to merge the two together, how do I do so?  I believe I have the latest Pages version of 5.1

    In that case you still have Pages '08/'09 in your Applications/iWork folder. Use that.
    Apple has removed this along with about 100 other features from Pages 5.
    All of this was news almost 5 months agao.
    Peter

  • Copying Nodes between Documents

    Hi everybody,
    I have a very strange problem and can�t explain why it occurs.
    I�m parsing a valid XML Document, i.e. producing an DOM Document, which I want to filter partially (which works very well). But when I have filtered some Nodes and when I try to add those in another DOM document, which I also read in, the program will stop without throwing an exception!!
    That�s my command:
    resultDocument.getFirstChild().appendChild(someFilteredNode);
    It won�t work...Does anybody know why this happens??
    Thanx for any answers!!
    Phil

    ok, it looks like you use some old parser.
    with something "recent", it should work - check:
    http://xml.apache.org/xalan-j/apidocs/org/w3c/dom/Document.html#importNode(org.w3c.dom.Node,%20boolean)
    or
    http://java.sun.com/xml/jaxp/dist/1.1/docs/api/org/w3c/dom/Document.html#importNode(org.w3c.dom.Node,%20boolean)

Maybe you are looking for