• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using folder pathname , save all images using script

New Here ,
Aug 31, 2012 Aug 31, 2012

Copy link to clipboard

Copied

Hi friends,

how can i copy the all image from the folder and save in different folder.

Thank you,

[ nav ]

TOPICS
Scripting

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Sep 01, 2012 Sep 01, 2012

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

Votes

Translate

Translate
Enthusiast ,
Sep 01, 2012 Sep 01, 2012

Copy link to clipboard

Copied

Hi,

mac or win? and how is ID involved¿

Hans-Gerd Claßen

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2012 Sep 01, 2012

Copy link to clipboard

Copied

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.extractLabel("",);

     var nav_folder_path = nav[2][1];

}

In windows

Thank you,

[ Nav ]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 01, 2012 Sep 01, 2012

Copy link to clipboard

Copied

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 ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2012 Sep 01, 2012

Copy link to clipboard

Copied

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.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 ]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 01, 2012 Sep 01, 2012

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines