Article View: adobe.scripting.indesign
Article #1447InDesign CS2 Error adding bookContents to a book
From: chus
Date: Tue, 10 Feb 2009 09:50
Date: Tue, 10 Feb 2009 09:50
23 lines
1681 bytes
1681 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 );
if(myBookFile.exists){//the book file exists
var myBook=app.open( myBookFile );
myBook.automaticPagination=true;
for ( i=0; i < myFiles.length; i++ ){ myBook.bookContents.add( myFiles[i] ); // ERROR:Process aborted by user } }else{ //the book file doesn't exist, so make a new one var myBook=app.books.add( myBookFile ); myBook.automaticPagination=true; 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:
<59b7d624.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,671a2fd49ba82a54,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!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: InDesign CS2 Error adding bookContents to a book Message-ID: <59b7d624.-1@webcrossing.la2eafNXanI> Date: Tue, 10 Feb 2009 01:50:04 -0800 Lines: 40 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit