4 Replies Latest reply on Mar 10, 2009 7:51 AM by (Olav_Kvern)

    Close all documents

    hm_arul Level 1
      Hi scripters,<br /><br />I have 15 documents open in my indesign application. I am trying to close all the documents. Please see my code below<br /><br />if(app.documents.length!=0)<br />{<br />for (i=0; i<app.documents.length; i++) {<br />app.documents.item(i).close(SaveOptions.no);<br />}     <br />     }<br />else {null;}<br /><br />if(app.documents.length!=0)<br />{<br />alert('All documents are closed')<br />}<br />else<br />{<br />alert('Still documents are opened')     <br />     }<br />It works good but, not all the documents are closed, before getting the app.documents.length=0 the alert box is popping. And still some documents are opened.<br /><br />Please advice me how can I close all the documents?<br /><br />thanks in advance<br /><br />regards<br />a r u l