Skip to main content
Known Participant
July 22, 2016
Answered

Loop Action

  • July 22, 2016
  • 2 replies
  • 4207 views

Hi,

I have an action that I would like to apply to all layers. I have 100+ layers, and I have added "select below layer" at the bottom of the action so essentially I could press "play" 100 times to get done, but is there a script, or function that will allow me to loop the action? I don't believe batch will work because I want the action to apply to all layers within the same composition.

Thanks!

Jackson

This topic has been closed for replies.
Correct answer c.pfaffenbichler

Seems like an issue for the Scripting Forum

Photoshop Scripting

Have not tested it, but for example:

Script I made: Iterate Action Over Layers

2 replies

kirank51547421
Participant
November 17, 2021

Here is a script, put this in a file RunActionX-Times.jsx(change the extension from .txt to .jsx) and copy to your Adobe Photoshop>Presets>Scripts folder on windows.

In Photoshop, your new script should appear under File>scripts. Just type in the number of times you want an action to run and VIOLA! Works like a charm!

 

Credit to jcombs

Link to original discussion

https://www.ozzu.com/questions/455621/photoshop-play-an-action-repeatedly#post-607170

c.pfaffenbichler
Community Expert
c.pfaffenbichlerCommunity ExpertCorrect answer
Community Expert
July 22, 2016

Seems like an issue for the Scripting Forum

Photoshop Scripting

Have not tested it, but for example:

Script I made: Iterate Action Over Layers

Known Participant
July 22, 2016

Hi c.pfaffenbichler,

Thank you for this reference. I used the code and it almost worked, but the action did not analyze each layer individually, rather took the first reading (Color Range) from the first layer and applied it to all of the following layers below it. This script can be used for a lot of other things, but I just need my action to loop so that each layer is individually analyzed by the action. I already have "select next sequential layer" at the end of the action, so all layers will be applied when it is looped.

If you have any other ideas on how I can loop an action please let me know.

Thanks!

Jackson

Stephen Marsh
Community Expert
Community Expert
July 22, 2016

Action A is the target action that Action B plays. I manually setup the required number of repetitions in Action B (so not really a loop, which would require a script). Obviously not very elegant but it does illustrate a point.

Action A is never played directly by the end user. Only Action B is played by the end user. Action A is a means to an end, action B will play action A.

Top image is before, bottom image is the result.