5 Replies Latest reply on Sep 1, 2012 3:16 AM by -hans-
      • 1. Re: Using folder pathname , save all images using script
        -hans- Level 4

        Hi,

         

        mac or win? and how is ID involved¿

         

        Hans-Gerd Claßen

        • 2. Re: Using folder pathname , save all images using script
          Nav_alm Level 1

          Hi,

           

          Below code to get the image sequence folder path.

           

          Using the folder pathname , save all image in my diff folder.

           

          and also id need every image name also.

           

          var doc = app.activeDocument;

           

          for (var j =0; j< doc.rectangles.length; j++) {

           

               var nav = doc.rectangles[j].extractLabel("",);

           

               var nav_folder_path = nav[2][1];

           

          }

           

          In windows

           

          Thank you,

           

          [ Nav ]

          • 3. Re: Using folder pathname , save all images using script
            -hans- Level 4

            Hi,

             

            sorry, but your snippet doesn't clear it up for me ...

             

            This copies a imageFile to a new Folder:

             

            var destFolder = '~/Desktop/myDest/'
            if(!Folder(destFolder).exists){Folder(destFolder).create()}
            
            var myImageItemLink = app.activeDocument.rectangles[0].images[0].itemLink;
            var myFilePath = myImageItemLink.filePath;
            var myFileName = myImageItemLink.name;
            var destFile = new File(destFolder + myFileName);
            File(myFilePath).copy(destFile);
            

             

            If your  'nav_folder_path' returns a Folder within more Imagefiles that you want to copy, then use 'getFiles()' to get a list of files, then copy them ...

            • 4. Re: Using folder pathname , save all images using script
              Nav_alm Level 1

              Hi my friend,

               

              I try creating 360 degree animation from indesign to HTML conversion.

               

              Now i get the folder name by using the below code, inside that folder more then 50 to 80 images are there i need to save those image in my folder and also i need each image name inside the script.

               

              var doc = app.activeDocument;

              for (var j =0; j< doc.rectangles.length; j++) {          

                   var nav = doc.rectangles[j].extractLabel("",);            

                   alert("Nav length "+nav.length);            

                   for(var nav_get_name =0; nav_get_name < nav.length; nav_get_name++) {                       alert(nav[nav_get_name][0]+"="+nav[nav_get_name][1]);         

                        var path_name =  (nav[2][1]);          

                   }

              }

               

              Thank you,

               

              [ Nav ]

              • 5. Re: Using folder pathname , save all images using script
                -hans- Level 4

                Hi,

                 

                 

                var destFolder = '~/Desktop/myDest/'; // your 'my Folder'
                var picNames = []; //array of names of copied images
                
                var path_Name = '~/Desktop/mySource/'; 
                var myPics = Folder(path_Name).getFiles('*.*'); //list files in folder
                
                var countFiles = myPics.length;
                
                while(countFiles--){
                    picName = myPics[countFiles].name;
                    picNames.push(picName);
                    myPics[countFiles].copy(File(destFolder + picName))
                        }
                

                 

                 

                Hope it'll work