Ian Campbell
Ian Campbell

Reputation: 2748

InDesign CS5 Script: How can I place another InDesign document into a new InDesign document?



I am creating a new InDesign document with  var newDoc = app.documents.add() .

I am trying to place another pre-existing InDesign document that has paragraph styles into the new document. The reason why I'm not simply using  styledDocument.execute()  is that it opens this pre-existing document, whereas I want the document itself to be "Untitled".

I am attempting to do this with  newDoc.place(styledDocument) , which is not working. The document is untitled as intended, but has the styled document as a link only, and is not populating the  Paragrah Styles  window with the styles from the styled document...


It is possible from  File --> Place...  in the InDesign menu to open another InDesign document into this one manually, in which the styles from this document do appear in the  Paragrah Styles  window... But I want to programmatically do this. So, I am assuming that  File --> Place...  from the InDesign menu is different than  newDoc.place(oldDoc).


Here is my code (which is not working):

var newDoc = app.documents.add();
newDoc.place(styledDocument);


Upvotes: 0

Views: 798

Answers (1)

Loic
Loic

Reputation: 2193

Wawawaaa, what is your final intention ? Load styles from doc A into Doc B ? If that so, why not use the document's importStyles method ? If you do want to import document as an image, you can use the place method and specify the document as any other image file.

Upvotes: 1

Related Questions