10 Replies Latest reply on Sep 12, 2015 7:09 AM by JJMack

    is there any script to rename the already existed smart object with the name of its mother file

    siddharthk61789754

      for eg:

      box1.psd have (red colored)   "ball" smart object and cat layer

      box2.psd have (yellow colored)"ball" smart object and dog layer

      box3.psd have (green colored) "ball" smart object and rat layer

      box4.psd have (pink colored)  "ball" smart object and mat layer

       

       

      i made an automation which saves cat layer as box1.jpg (this is fine)but when i click edit content of (red)"ball" object and save it in save as web in .png it save as (red)"ball" (its ok for the box1.psd file) but while running a batch for all the box files  it is not fine because i am expecting box2.psd to give a dog.jpg and a (yellow colored)ball.png but it over writes the already created (redcoloured) ball with (yellow colored) ball (this is not fine).

       

       

      so is there a script which can rename the smart objet same a its mother file or any script which can save .jpg and open smart object and save as .png with series of numbers as prifix or sufix.

      thanks in advance

        • 2. Re: is there any script to rename the already existed smart object with the name of its mother file
          JJMack Most Valuable Participant

          siddharthk61789754 wrote:

           

          for eg:

          box1.psd have (red colored)   "ball" smart object and cat layer

          box2.psd have (yellow colored)"ball" smart object and dog layer

          box3.psd have (green colored) "ball" smart object and rat layer

          box4.psd have (pink colored)  "ball" smart object and mat layer

           

          What is the eg: trying to convey.  PSD files are layers document do they have some common structure?

           

          i made an automation which saves cat layer as box1.jpg (this is fine)but when i click edit content of (red)"ball" object and save it in save as web in .png it save as (red)"ball" (its ok for the box1.psd file) but while running a batch for all the box files  it is not fine because i am expecting box2.psd to give a dog.jpg and a (yellow colored)ball.png but it over writes the already created (redcoloured) ball with (yellow colored) ball (this is not fine).

          Can you expand and show us your action?  The one you could not get to work batched the way want it to work.  So we may get some idea of what your trying to do..

          siddharthk61789754 wrote:

           

          so is there a script which can rename the smart objet same a its mother file or any script which can save .jpg and open smart object and save as .png with series of numbers as prifix or sufix.

          thanks in advance

          What does that mean. Do you want to rename the smart object layer mane, Or replace to contents of the layers object. How was the Smart Object layer created.  There are many ways to create smart  object layers. Was an image file placed into the PSD if so was it a linked place or and embedded placer file. I do not known if object have names. If you open a smart object that is an embedded object the work file will have a name that is associated with what was used creating the Smart Object Layer.  If it was created as a placed linked image the master file will be opened either in Photoshop or Camera Raw. If the Late was dropped in from some other Adobe application That Application may be used to reopen the object.

           

          If you want to Batch Process Image Files and be able to save them with name you want used.  You should look at Photoshop Script "Image Processor"  menu File>Scripts>Image processor.  A more powerful and flexible plug-in script "Image Processor Pro" can be downloaded from the web and installed into Photoshop. Once installed you can access in via menu File>Automate>Image Processor pro.   It a plug-in so you can also use it in actions. and you can use action you create in these Image Processing scripts.

          1 person found this helpful
          • 3. Re: is there any script to rename the already existed smart object with the name of its mother file
            siddharthk61789754 Level 1

            sorry for the unclear explanation, and thanks for your quick response.

             

            - There is a fresh unused temp-let named "X.psd" with a embedded smart object named "X"            

            - I need a script which can link smart object X name with the X.psd name

            - If i rename "X.psd" to "Y.psd" then automatically the smart object "X" inside the X.psd should also change to smart object "Y".

             

             

            In my previous request i tried to explain my work process,now i am trying to make it clear.

            If i have to do some 50 images that day, first i make 50 copies of the temp-let  X.psd and rename the copies with the names of 50 different images on which i have to work using a bat script file. so each X.psd is renamed with some name from the 50 images, but the embedded smart object "X" inside the copies of X.psd's which has to be saved as png for web does not get renamed, because of this when i try to save the png of the smart objects in automated batch they get over writed with the same as X, instead of renamed name of the X.psd's

             

             

            after working on all the psd files i will use a action to save the output images and this is my action :

             

            open X-1.psd (which is a copy of X.psd temp-let but with some different images inside the file)

            hide X smart object (i hide this smart object in order to save a jpg image of the other layers bellow the smart objet)

            save for web  jpeg with optimize to file size 350k and save in the target path

            edit contents of X smart object

            save for web png and save in the target path

            close X smart object

            close X.psd

             

             

            in the bath when its running for the X-2 its saving png with X name instead of saving as X-2

            and for X-3, X-4 and so on and the final result is ending up with only one X png

            ------------------------------------------------------------------------

            Thanks in advance.

            • 4. Re: is there any script to rename the already existed smart object with the name of its mother file
              JJMack Most Valuable Participant

              siddharthk61789754 wrote:

               

              sorry for the unclear explanation, and thanks for your quick response.

               

              - There is a fresh unused temp-let named "X.psd" with a embedded smart object named "X"           

               

              Lets start with line 1.

               

              ' There is a fresh unused temp-let named "X.psd" with a embedded smart object named "X" '

               

              What does that mean to you for me it pure garbage

               

              How I read that

              There is a fresh unused temp-let ???? temp what is a temp-let

               

              named "X.psd"    'X.psd' That read like a temp-let is a file.  If it is a file where did it come.  Photoshop is not a file editor it edits old and creates new Photoshop documents. A new document has no backing file till Photoshop is used to save one.

               

              with a embedded smart object named "X"    if the file x.psd has a embedded smart object names x its not a fresh unused temp-let where did x come from.

               

               

              I know you have something in mind that you want to do.   However you do not seen to know how to describe what that is.  So far its Garbage in Garbage out...

               

              Just describe what you you want to do in layman English do not try to describe the process in Photoshop processing function steps.   If you have some sort a Photoshop PSD template. Please describe the structure of that document we need to know that.  Smart Object Layer are really best in Photo Package template where you replace the content of a shared object so all the image layer change with the one replaced shared object.  Smart object layers are not normally used when you would like to use any size image.to populate your template.  For you  need to replace a object with an object  exactly the same size object as the object being replaced. If you do not the transform associated with the smart object layer does not work correctly with the replacement.. The  Smart Object Layer Associated transform is not replace when you replace the object.  The replacement object must be the same size as the object being replace. You can populate a template with smart object layers you transform for the template. .

              • 5. Re: is there any script to rename the already existed smart object with the name of its mother file
                JJMack Most Valuable Participant

                 

                In my previous request i tried to explain my work process,now i am trying to make it clear.

                If i have to do some 50 images that day,

                If all you desire is to make 50 populated psd template file with your 50 images as a smart object layer.  That is very easy to to with my Batch populate single image photo collage script. You simple create a template. The size you want the document to be.  It must contain a Background layer and also contains an alpha channel named "Image 1" that maps to the location you want the image to be.  If you do not want any fancy frame or other embellishment. That would all you would need for the template psd.

                You would run my script point it to the template you created, point it the folder containing you images and point it to where you want the populated templates saved. The click create collages.  Your 50 PSD file will be created in the folder you set up.

                 

                 

                A video showing a 5 image collage PSD template  being populates with images: and left open in Photoshop so one could tweak it. Note the 5 smart object image layers created.

                • 6. Re: is there any script to rename the already existed smart object with the name of its mother file
                  JJMack Most Valuable Participant

                  I created a one image collage template with an addition image overlay layer. I pointed my script at it, five images and an output folder on my desktop.  Here is the scripts dialog filled out. Windows File Explorer displaying the source image folder file sizes.  The Template opened in Photoshop showing the Composite,  layers palette and channels palette.. Also Photoshop File Open showing the 5 populated collages and their files names the script created and saved.

                  Capture.jpg.

                  • 8. Re: is there any script to rename the already existed smart object with the name of its mother file
                    JJMack Most Valuable Participant

                    There are may way to design and create templates. You need to populate template according to their design.   For myself I created a very simple design that would be easy to populate with a script.  Smart Object layer are normally used only in Picture package templates for all images use must be exactly the same size as the object used in the template.

                     

                    The template you show has two images.  A background image and a logo images that is a smart object.  The intent of the template is more a template for you to make your own template from where you replace the logo png smart object layer with your own logo.  You would do that by using menu File>Place embedded and place in your own png logo that  you would use the place transform to size and locate your logo for the template.  Then you would  delete the original logo smart object layer. You would then save your own Template.  That you would use to populate you collages.  You would open the Template in Photoshop pace in an image over the background layer below all the other layers including your logo png smart object layer. The image would be framed by the framing layers and your logo would be over your image.  You would then save a jpeg for from the populated template. Then close without saving the template .

                     

                    It is not easy to populate templates with actions particularity batch action. Action can not use logic or easly name save file.  They need to know the exact details of the template. How many image there are there size placement model layer name etc. every template would need a custom action.   I start off that way and was able to come up with a template design that was easy to populate. Still I needed to have actions to populate templates that had one image and an action for templates with two image etc.  So I turned to scripting for scripts can use logic a generate file names size image etc.

                     

                    Photo Collage Toolkit

                     

                    Photoshop scripting is powerful and I believe this package demonstrates this A video showing a 5 image collage PSD template  being populates with images:

                     

                    The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.

                    1. Size the photo collage templates for the print size you want - width, height and print DPI resolution.
                    2. Photo collage templates must have a Photoshop background layer. The contents of this layer can be anything.
                    3. Photo collage templates must have alpha channels named "Image 1", "Image 2", ... "Image n".
                    4. Photo collage templates layers above the background layers must provide transparent areas to let the images that will be placed below them show through.

                     

                    There are twelve scripts in this package they provide the following functions:

                    1. TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
                    2. CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
                    3. LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
                    4. InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
                    5. ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
                    6. ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well.
                    7. PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
                    8. BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
                    9. BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
                    10. BatchPicturePackage.jsx - Used to Automatically Batch Populate Any Photo Collage template with an image in a source image folder
                    11. PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
                    12. PCTpreferences.jsx - Edit This File to Customize Collage Populating scripts default setting and add your own Layer styles.

                     

                    Documentation and Examples

                    • 9. Re: is there any script to rename the already existed smart object with the name of its mother file
                      siddharthk61789754 Level 1

                      hello sir,

                      sorry for the late reply ,

                      i have worked on all  the scripts which you had shared with me. the the scripts functionality is really owsome. but unfortunately  my requirement is some thing different .

                      my core requirement is to save images in  png for web with sequential numbers as suffix or prefix in automation batch .

                      • 10. Re: is there any script to rename the already existed smart object with the name of its mother file
                        JJMack Most Valuable Participant

                        Look at the downloadable Photoshop plug-in script image processor pro.