Article View: adobe.scripting.indesign
Article #9082Re: JS Batch converter for CS2
From: Dave_Saunders
Date: Fri, 15 Sep 2006 01:18
Date: Fri, 15 Sep 2006 01:18
14 lines
1488 bytes
1488 bytes
Interesting. I get the same result. It looks as though exportFile is working on only the frontmost document.
Looks like your instinct was right to try to bring the document to the front, but that means being careful about using the index. This works:
if(app.documents.length != 0){
var myFolder = Folder.selectDialog ("Choose a Folder");
if(myFolder != null){
for(i= 0; app.documents.length > i;i++){
app.activeDocument = app.documents[-1];
myName=app.documents[0].name;
myFile=new File(myFolder+"/"+myName.replace( /\.indd/, '.pdf' ));
app.documents[0].exportFile(ExportFormat.pdfType, myFile, false);
}
}}
Technical Details
Message-ID:
<3bbf225d.22@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!colt.net!feeder.news-service.com!txtfeed1.tudelft.nl!tudelft.nl!txtfeed2.tudelft.nl!multikabel.net!feed20.multikabel.net!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!news.isoc.lu!webcrossingReferences:
<3bbf225d.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,fd17be16b0df5a69 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!colt.net!feeder.news-service.com!txtfeed1.tudelft.nl!tudelft.nl!txtfeed2.tudelft.nl!multikabel.net!feed20.multikabel.net!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: JS Batch converter for CS2 Message-ID: <3bbf225d.22@webcrossing.la2eafNXanI> Date: Thu, 14 Sep 2006 18:18:51 -0700 References: <3bbf225d.-1@webcrossing.la2eafNXanI> Lines: 16 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit