Skip to main content
Participant
September 6, 2015
Question

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

  • September 6, 2015
  • 2 replies
  • 1494 views

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

This topic has been closed for replies.

2 replies

JJMack
Community Expert
Community Expert
September 6, 2015

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.

JJMack
Participant
September 7, 2015

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.

JJMack
Community Expert
Community Expert
September 7, 2015

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

JJMack
Chuck Uebele
Community Expert
Community Expert
September 6, 2015

Moving to Photoshop Scripting forum.