What you could do is open each document, copy the pageitems on it spread wise, because you won't be able to select pageitems on different spreads. Then paste these pageitems onto your new document. If you want you can also preserve the layers on which the pageitems were placed on the original document while pasting the pageitems on the destination document.
Hope this helps your cause.
- Efficient InDesign Solutions
Thanks for the reply! Looking through the CS5 JS object reference guide, I'm not seeing how you'd copy and paste pageItems. Unless you're talking about the duplicate() function, which I've already tried. I can't copy & paste pageItems individually I don't think, because the ultimate goal is to have all of the content on a page placed onto a new page at specific coordinates (as if the page were placed on the new page). That's why I was hoping to group all of the pageItems and then duplicate that group onto my new page, and then move that group to the coordinates I need.
Hopefully that makes sense.
iterate through the spreads of the source documents as i explained before, then for each spread traverse the paeitems on that spread and add them to the selection with the statement
once all the items of a spread are selected use
then change over to the destination document i.e. make the destination doc as the active document and then use
repeat this process for every spread in the document, and remember to remove the selection before moving on to selecting the page items on the next spread.
Hope this clears what i am trying to explain and it solves your issue.
- Efficient InDesign Solutions
1. I've always tried avoiding using application settings/functions (i.e. app.copy()) because our scripts will be run on InDesign server and I'm not sure if wires can get crossed if multiple scripts are running at once). Are you familiar with how that would work on InDesign server? We've got one server with multiple instances, but I'm not sure if "application" is shared across instances or not?
2. After I call app.paste() how can I move all of those page items (as a group) to one specific set of coordinates? Can I call a move function on the current selection similar to Group.move? I need the end result to be as if I placed page 1 of document A onto page 1 of document B at coordinates (X,Y). Page 1 of document B will be smaller, and able to fit completely onto page 1 of Document A, but I obviously can't place a page onto another page, which is why I'm just trying to copy content over as I've explained.
And thank you again!
For the first point i am not sure if you will indeed run into any issues, we never got into any problems using application level methods on the IDS. However you will have to try and create a case where you think this might create a problem and share your observations here for the benefit of others too:)
And for the second point you could maybe try the app.pasteInPlace() method rather than app.paste() and see if it works for you. Anyhow how are you creating the group that you are failing in some cases. Give the code so that i can see if i can figure out something that might be missing from your eyes....
Thank you, if we go that route with app.copy() and app.paste() I'll definitely post any issues I come across.
For the code that wasn't working for me before - I may have actually just found a solution for that. It appears to actually work groupiing page.pageItems if I make sure that none of the pageItems are locked beforehand. So right now I'm looping through pageItems, and unlocking each item as I go, putting them into a new array. From that array I can group the items successfully.
If this continues to work the way I need it to, I'll likely go with this solution.