Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to import Document in a book

New Here ,
Mar 11, 2008 Mar 11, 2008
I am using cs3 (Mac os x).
I created a book using javascript and then i save it.

app.books.add(myPath + Save + ".indb");
app.activeDocument.save(File(myPath + Save + ".indb"), false);

My question is i need to add or import all the file into that book.
I need to add all the document into the book these document are in the same folder where i save the book. Is there any way that i can add all the file from that folder to the book.

--Avi
TOPICS
Scripting
481
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 11, 2008 Mar 11, 2008
from VB ObjectBrowser - I hope this helps you:

Function Add(FullName As String) As BookContent
Member of InDesign.BookContents
Create a new Book Content / Return value: The new book content / FullName: Full path name of the new book content

myBook.BookContents.Add("C:\book\Chapter1.indd")

robin

--
www.adobescripts.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 11, 2008 Mar 11, 2008
I need to do three things in this code.

1) I need to create a book.
2) THEN ADD all the file in that book(This all file are content in a folder).
3) Then save this book in the same folder from where i took the file.

I am trying use

app.bookContents.add(myPath + Save + ".indb");
But i am getting error as object does not support the property.
Can anybody help me to get this three things done.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2008 Mar 12, 2008
LATEST
"books" is a property of the app, so to create a new book, you do app.books.add(...). But bookContents is a property of a book, not of the app. Robin said as much in his post, which you chose to ignore.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines