8 Replies Latest reply on Jul 24, 2011 7:22 PM by xbytor2

    Dynamic folder creation possible?

    Janice-83

      Hi all-- I'm new to the scripting thing and have been trying to learn but am getting nowhere. Wondering if anyone could help me.

       

      My current workflow is:

      Batch including all subfolders using an action that crops, levels, and adds a border then saves the image as tiff to a folder called tiff, resize and save as jpg to another folder called jpg.

       

      It's a pain sorting through the tiff and jpg folders to separate out the images into new folders named as per the originals.

       

      Is there any way to have a script look at the folder you are currently batching from and create and save to folders in each of the tiff and jpg folders named as per the original folder being batched from?

       

      I would appreciate any help or advice you may be able to give.

       

      Janice

        • 1. Re: Dynamic folder creation possible?
          JJMack Most Valuable Participant

          Photoships with a script named "Image Processor" and Dr Russell Browns web site has a script you can download named something like "Image Processor Pro" I think you should look into these. All you may have to do is create a simple action and use one of these scripts to do most of the work you want done and have it include your action during its processing. 

          • 2. Re: Dynamic folder creation possible?
            Janice-83 Level 1

            Hi there- thanks for the response.

            I tried the Dr. Brown script, and it doesn't work for my application, as I have multiple save and correction steps. This would require all of my changes to be made before going through the Image Processor.

            • 3. Re: Dynamic folder creation possible?
              JJMack Most Valuable Participant

              Janice-83 wrote:

               

               

              My current workflow is:

              Batch including all subfolders using an action that crops, levels, and adds a border then saves the image as tiff to a folder called tiff, resize and save as jpg to another folder called jpg.

               

              Janice

              Now if you modify your action just a little bit I think you should be able to use the images processor pro script. Your action now does the following crops, levels, and adds a border then saves the image as tiff to a folder called tiff, resize and save as jpg to another folder called jpg. If you delete the endng steps your action would do crops, levels, and adds a border. This shorter simpler acttion should now be all you need  to do what you want to do by using it with the Image Processor Pro script.

               

              With the Image Processor Pro script you can save as many version of your images the you neet to. If you look at the image processor pro dialog it should easy to see that you can do what you want to do with the scipt and a single simple action. If you ouput requirement were more complex you might need to use more then one action. You have the option to use a different action for each image version you save.

              ImageProcessorProDialog.jpg

               

              You see four sections.

               

              Section  1 Images if your images are ina a tree you could proces  the whole tree, Part of the Tree, a folede or juset the currently open documents.

              Section  2 Save image location quite flexable as to where you output can bes saved

               

              Section 3 File Types. This is a very flexable area you can save many different File Types and save as many versions to meet you needs.

              for each there are options, save,  File Type save options, optional resize with option, sub folder and file name my image show two of the tabs and the option like file types to save only the jpeg tab without the * would be saved here.

               

              You can add and delete tabs. the + and - buttons you could set uo a Tiff tab and a jpeg tab and use the same action. The Tiff not resize the Jpeg resized. The image is only opened once. The script just reverts the image back to the state it was in  before the processor saved any version after it saves a version.

               

               

              Section 4 Copyright Info

              • 4. Re: Dynamic folder creation possible?
                Janice-83 Level 1

                Hi again,

                 

                Thanks for all of the advice, but this script still does not do what I need it to.

                The first step in my workflow has to be a crop, which works with the Image Processor Pro by having it save to tiff after it triggers an action, however, when it goes to the jpeg step it goes it goes back to the original uncropped image, which is uncropped. It does create folders and save the files in the appropriate locations.

                 

                My workflow using the Image Processor Pro and actions is as follows:

                 

                Image Processor Pro set to include all subfolders and keep folder structure

                Set 1 save as tiff and run action 1 (which crops and corrects the image)

                Set 2 save as jpg and run action 2 (which adds a border and watermark and resizes for the web)

                 

                This creates properly named subfolders containing jpeg and tiff copies of each image, which is good, but the jpeg images have not gone through the action 1 step and are therefore not cropped. I know I could set up action 2 to include another crop step, but that seems redundant. There must be a chunk of code I could use to do this elegantly. I even tried taking apart the Dr. Brown script with no luck.

                • 5. Re: Dynamic folder creation possible?
                  xbytor2 Level 4

                  If you have fixed folders that you always use, you could record an action that calls Image Processor Pro (IPP) to do the crop/tiff processsing

                  then record a second call to IPP that uses the output folder from the first step as the source folder for the second step.

                   

                  If this doesn't quite fit your workflow, you can always hack IPP to make it do what you want since you do have source

                  1 person found this helpful
                  • 6. Re: Dynamic folder creation possible?
                    Janice-83 Level 1

                    I thought of that as well, but the problem is that the folder is now dynamically generated, so there is nothing I could point to before starting the first script.

                     

                    My problem is that I understand generally what is happening with the javascript, but would not be able to write my own, and my attempts at copying/moving code around the Image Processor Pro script have failed.

                     

                    I have a feeling that this will require a chunk of extra code.

                    • 7. Re: Dynamic folder creation possible?
                      JJMack Most Valuable Participant

                      Janice-83 wrote:

                       

                      Hi again,

                       

                      This creates properly named subfolders containing jpeg and tiff copies of each image, which is good, but the jpeg images have not gone through the action 1 step and are therefore not cropped. I know I could set up action 2 to include another crop step, but that seems redundant. There must be a chunk of code I could use to do this elegantly. I even tried taking apart the Dr. Brown script with no luck.

                       

                      It might seem redundant but is not. As I wrote after a version is save the Images Processor Pro reverts the image back to the original file open state.  So it back to its original state not resized and without any alteration preformed by any action as you have observed.  The Image Process Pro allows you to process your Original Image as many ways as you need to. Nothing accumulates. If your processing files not open documents the files are opened once and remain unaltered and the save versions are independent and have no effect or any other version. This is elegant what your trying to do would be ugly IMO have version accumulate effect would prevent you from creating independent versions and a version may have done some destruction to a point you can not create the version you want to create.

                       

                      I wrote you could use a single action for the way you wrote about your work flow you stated "My current workflow is: Batch including all subfolders using an ""action that crops, levels, and adds a border then saves the image as tiff to a folder called tiff, resize and save as jpg to another folder called jpg."" "  With that action both the Tiff and Jpeg versions would have the border. Now you have changed your story. Your Tiff does not have a border only the jpeg version does. Your output is more complex  you need two actions. Action 1 crops and levels.  Action 2 crops, levels, and adds a border.  The Image Processor Pro gives you versions where everything is independent simple straight forward easy no interference...   Now you can accumulaye things if you wish.  You could have action 1 and have an action 2 that plays action 1 and then add a border.  Version Tiff is still independant from version Jpeg.  You just include one action in a second action and accumuate you steps that way..

                       

                      I have not looked at The Image Processor or Image Processor Pro code.  I don't feel I need to either. It would be very easy to revert the image back to the original  open state. All the script needs to do is dupe the current document and create the version from the dupe after the version is saved then all the script needs to do is to close the dupe it created the version from without save. Dupe and create next version  all versions created  close image and move on to the next image. Simple elegant.

                       

                      The script does all the hard work for you. Batch, handles output location. Has a self modifying dialog the lets tailor the number of output file types you want to create. You can tailor all file type save options, optionally resize and control output file naming.  Its action running options enable you to put your own spin on versions. The script even has plug-in code support so it can be recorded it use in actions and bypass it dialog when the action is played. It is a very complex script well beyond elegant. All you need to do is create some simple actions to tailor versions of your images. While your computer grinds away your free to have a life.

                      • 8. Re: Dynamic folder creation possible?
                        xbytor2 Level 4

                        IPP uses an XML file for its settings. You could have a master script the writes/modifes the xml file for each stage to compensate for the fact that the folder paths are not static then calls IPP.