1 Reply Latest reply on Jul 7, 2015 11:06 PM by Peter Spier

    deleting idms

    indesignp36139849

      Hi ,

       

      Could some one help me in this case ....

       

      Am not very sure how i can avoid this Error in below specific case: (Either the file does not exist, you do not have permission, or the file may be in use by another application)

      Case 1: I am successful in placing  idms for first time in to my local folder and to ID document , but once i delete same file from both local folder and ID document and trying  to place same images on same page results me with adove error.

       

       

      public function snippetPlacmentComplete(file:File,object:Object):void{               

                      try{                   

                          placeSnippet(file,object);                                               

                      }catch(err:Error){                    

                          tempPlaceSnippet(file,object);

                      }               

                     

                  }

       

       

      public function placeSnippet(file:File,object:Object):void{

                

                         var myDocument:Document = app.activeDocument;                 

                                  

                          var activePageNumber:String = mx.core.Application.application.pageNumber();   

                          var page:Page = myDocument.pages.item(activePageNumber);

                          page.place(file);

                                

         }                           

                   

            

                 

        public function tempPlaceSnippet(file:File,object:Object):void{

       

                      var tempPath:File=null;

                      var curOS:String =    ModelCommon.getInstance().determineCurrentOS();

                  

                 try{                    

                          if(curOS!="mac") {

                              tempPath = new File(ModelCommon.getInstance().downloadPath+File.separator+"snippets"+File.separator+deco deURIComponent(object.imageName));

                          }else {

                              tempPath = new File(ModelCommon.getInstance().downloadPath+"snippets"+File.separator+decodeURIComponent( object.imageName));

                          }                   

                         

                          file.copyTo(tempPath,true);                    

                         

                                  var    myDocument:Document= app.activeDocument;                          

                                  var activePageNumber:String = mx.core.Application.application.pageNumber();   

                                  var page:Page = myDocument.pages.item(activePageNumber);

                                  page.place(tempPath);

                                  page.place(file);                                               

                                                   

                          }catch(chatchexception:Error){                       

                              myLogger.error(chatchexception.message);                     

                          } 

                          

                          tempPath.deleteFile();

                          tempPath.parent.deleteDirectory();                  

                      }catch(error:Error){         

                          myLogger.error(error.message);             

                      }   

          }

       

       

      i tried to avoid it with above way as in  'tempPlaceSnippet method , but it only helps me in fixing for images but not for idms snippets .

       

      Thanks in advance .