🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1496

Re: InDesign CS2 Error adding bookContents to a book

#1496
From: chus
Date: Wed, 11 Feb 2009 14:24
31 lines
1821 bytes
Hi Dave
The idea is filter the files "*.indd" of the folder "Users/INDD" and then insert them in the book "BookINDD.indb". This script must be executed on InDesignServer. When I executed it, I get the error // ERROR:Process aborted by user, in the next line of the script: myBook.bookContents.add( myFiles[i] );

I write de script again:

//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( "*.indd" );
  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 in advance
Chus
Technical Details
Message-ID: <59b7e14b.1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
References: <59b7e14b.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,671a2fd49ba82a54
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: chus@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: InDesign CS2 Error adding bookContents to a book
Message-ID: <59b7e14b.1@webcrossing.la2eafNXanI>
Date: Wed, 11 Feb 2009 06:24:33 -0800
References: <59b7e14b.-1@webcrossing.la2eafNXanI>
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit