Question
InDesign CS2 Error adding bookContents to a book
Hi all,
I want create a book in InDesign CS2 and add indesign documents to it using javascript and I get this error //ERROR:Process aborted by user What's wrong with this script?
//DESCRIPTION: Create a book and add indd-files of a choosen folder
var path = "//Users/INDD";
var bookname= "BookINDD";
var myFolder = new Folder(path);
if( myFolder != null ){
// get indd-files of choosen folder
var myFiles=myFolder.getFiles( ficheroIndd );
if ( myFiles.length > 0 ){
var myBookFileName = myFolder + "/"+ bookname + ".indb";
var myBookFile = new File( myBookFileName );
//the book file exists
if(myBookFile.exists){
var myBook=app.open( myBookFile );
myBook.automaticPagination=true;
}else{
//the book file doesn't exist, so make a new one
var myBook=app.books.add( myBookFile );
myBook.automaticPagination=true;
}
//add indd-files to a book
for ( i=0; i < myFiles.length; i++ ){
myBook.bookContents.add( myFiles ); // ERROR:Process aborted by user
}
myBook.save( );
}
}
Thanks,
Chus.
I want create a book in InDesign CS2 and add indesign documents to it using javascript and I get this error //ERROR:Process aborted by user What's wrong with this script?
//DESCRIPTION: Create a book and add indd-files of a choosen folder
var path = "//Users/INDD";
var bookname= "BookINDD";
var myFolder = new Folder(path);
if( myFolder != null ){
// get indd-files of choosen folder
var myFiles=myFolder.getFiles( ficheroIndd );
if ( myFiles.length > 0 ){
var myBookFileName = myFolder + "/"+ bookname + ".indb";
var myBookFile = new File( myBookFileName );
//the book file exists
if(myBookFile.exists){
var myBook=app.open( myBookFile );
myBook.automaticPagination=true;
}else{
//the book file doesn't exist, so make a new one
var myBook=app.books.add( myBookFile );
myBook.automaticPagination=true;
}
//add indd-files to a book
for ( i=0; i < myFiles.length; i++ ){
myBook.bookContents.add( myFiles ); // ERROR:Process aborted by user
}
myBook.save( );
}
}
Thanks,
Chus.
