Skip to main content
Сергій Марищук
Participating Frequently
May 18, 2021
Answered

how can I link the filename to the visible layer?

  • May 18, 2021
  • 4 replies
  • 1435 views

I am using "Actions" to apply patches to the posters. Each poster must have the same title + _language

 

 

I have to save the JPG in a separate folder every time, and then rename and move it to the same folder

 

This topic has been closed for replies.
Correct answer Kukurykus

yes


Does it solve your problem?

4 replies

Bojan Živković11378569
Community Expert
Community Expert
May 19, 2021

Perhaps you can solve problem by using Window > Layer Comps but that option is requiring additional work to create layer comps although and that can be automated what depends on what exactly you need and whether group names are always the same.

 

If provided script works for you then you do not have many reasons to think about layer comps and File > Export > Layer Comps to Files.

Stephen Marsh
Community Expert
Community Expert
May 19, 2021

@Сергій Марищук 

 

Are any of the replies so far helpful/correct?

Сергій Марищук
Participating Frequently
May 19, 2021

Пока-что еще не разобрался, отпишу когда все обдумаю хоршо

Kukurykus
Legend
May 19, 2021

Have you tried my code?

Kukurykus
Legend
May 18, 2021

 

with(activeDocument) saveAs(File(path + '/' + name
.replace(/(?=\.\w{3}$)/, '_' + activeLayer.name)))

 

Сергій Марищук
Participating Frequently
November 24, 2021

tnx

Kukurykus
Legend
December 29, 2021

You marked wrong answer as correct solution. Please unmark that to mark correct one 😉

Сергій Марищук
Participating Frequently
May 18, 2021

I am using "Actions" to apply patches add badges to the posters.

JJMack
Community Expert
Community Expert
May 18, 2021
  • To Automate that you would need to use Photoshop Scripting. Actions can not use logic to generate file name for savings from layer names. if all your poster documents have the same structure you could likely script a batch processor that save file with names like Poster Name - Layer Name .
JJMack