Skip navigation
Currently Being Moderated

Save As -> Settings and Filename Incrementer

Jul 12, 2012 8:52 PM

Hello All,

 

I'm on CS5/CS6, i use a panel which i created in configurator. I have it run actions, menu items etc. All works great.

 

Problem:

 

I'm sick and tired of saving each open active image as JPG and incrementing the filename by 1.  I'm hoping someone can point out to me on how to increment the filename number by 1, from a panel with a button called say - "Save As Increment"

 

So to play this out in a real world scenario....

 

1. Photoshop open.

2. Image file open and active.

3. I save the first file with name 'GeorgePortrait01.jpg' by clicking the save as button on my configurator panel and giving it the name manually.

4. > I want to now work on active/open image #2, when i'm done processing that, i'd like to click on my other button hypothetically called 'Save As Increment' which i just click and in the background it:

     A) Takes my settings specified in the script file for quality etc...

     B) Takes my folder location info also set in the script file

     C) Finds the latest incremented number in the folder and then increments by 1

     D) Saves it as GeorgePortrait02.jpg

 

So after the script modifications and the first file save, from then on after i'm done with each image, i only have to click the button 'Save As Increment' from that point on until i'm done with the set.

 

Is this possible? I'd like a vb script solution if possible. Any advice is hugely appreciated.

 

 

TIA!

 
Replies
  • Currently Being Moderated
    Jul 16, 2012 1:43 AM   in reply to Brendan Stewart

    You asked for vb which may put off most here… as you are open to altenatives… This I just C&P from Tom's Event Manager Script…

     

    ////////////////////////////////////////////////////////////////////// /////////

    // Function: CreateUniqueFileName

    // Usage: given a folder, file name and extenstion create a file with a unique

    //        file name

    // Input: given a folder, file name and extenstion

    // Return: the full path to the unique file

    ////////////////////////////////////////////////////////////////////// /////////

    function CreateUniqueFileName( inFolder, inFileName, inExtension ) {

              var uniqueFileName = inFolder + inFileName + inExtension;

              var fileNumber = 1;

              while ( File( uniqueFileName ).exists ) {

                        uniqueFileName = inFolder + inFileName + "_" + fileNumber + inExtension;

                        fileNumber++;

              }

              return uniqueFileName;

    }

     

    Simple enough…

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 16, 2012 6:17 AM   in reply to Brendan Stewart

    I posted this just to show the basic principle… It should just keep adding 1 until a file is not found on system… I think it may be easier for you to translate than call Im yet to try configurator so Im unsure what you are doing…

     
    |
    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