Skip navigation
Currently Being Moderated

Copy all images from folder to global-folder when saving

Jul 25, 2012 7:21 AM

Tags: #detect #paste #folder #copy

I want to have a help here to do this:

 

When I activate my saveCorrection script, I  use it to modify/correct a single image tha it is present on a folder of 5, 6 or 7 images).

This means that I will have inside that folder 1 corrected images and also the other images I will need.

To simplfy my daily upload work, I decided to avoid uploading each individual folder each time I make a correction. So I start saving each corrected image to a daily global folder on my desktop.

At the ende of the day, I upload all my daily images I have corrected from that folder.

This is done and works great but I need also to upload the other not corrected images from that global folder.

 

For example:

 

Folder1 has 6 images

Folder2 has 5 images

Folder3 has 6 images

Folder4 has 4 images

 

I correct image1 from Folder2

and image4 of Folder4

 

The global folder needs to have not only this 2 images but also needs to read all the present images from a folder that had a correction and pasting them to the global daily folder.

 

At the end of the day I must have

GlobalFolder with 9 images from Folders 2 and 4

 

So I can I detect present files on a folder and passing them to another?

 
Replies
  • Currently Being Moderated
    Jul 26, 2012 1:00 AM   in reply to Pedro Marques

    At the ende of the day, I upload all my daily images I have corrected from that folder.

    upload where?

    Could you possibly clarify your workflow with a chart or something?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 26, 2012 2:53 AM   in reply to Pedro Marques

    I assume you are on Windows, so something like this

    // 2012, use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
    var thePath = myDocument.path;
    var theFiles = Folder(thePath).getFiles(/\.(jpg|tif|eps|psd)$/i);
    alert (theFiles.join("\n"))
    };
    

    should get you the neighboring jps, tiffs, eps’, psds … amend the filter as needed.

     

    Then you can iterate through the array (Edit: with a for-function) and use the method

    File.copy (target: string)

    to copy them somewhere else.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points