Article View: adobe.scripting.indesign
Article #1486InDesign CS2 Error when yout add a bookContents to a book
From: chus
Date: Wed, 11 Feb 2009 09:53
Date: Wed, 11 Feb 2009 09:53
30 lines
1648 bytes
1648 bytes
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[i] ); // ERROR:Process aborted by user } myBook.save( ); } }
Thanks,
Chus.
Technical Details
Message-ID:
<59b7e14c.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,d6316d38073899dc,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: chus@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: InDesign CS2 Error when yout add a bookContents to a book Message-ID: <59b7e14c.-1@webcrossing.la2eafNXanI> Date: Wed, 11 Feb 2009 01:53:52 -0800 Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit