Skip to main content
Participant
Mar 9, 2020 6:13 PM UTC
Answered

Trying to run an action on loop

Hi there, I have a large amount of images (~7000) and I'd like to stitch 4 of them together in a quadrant and save it as a file.

Currently I import about 250 into separate layers and I made an action that aligns them to each corner to complete the quadrant, but I have to continually click the Play button to process all the images.

Is there a way to repeat the action in some kind of loop? I can't use automate>batch because all the files are in the layers and are deleted as they are stitched.

I've tried to use a script to play another action which has a script that plays the initial action but then I get an error when it starts the 2nd Action.

"Could not complete the command because Photoshop was unable to find the Javascript file"

These are the 2 separate scripts:

app.doAction("Action2","Set2.ATN")

app.doAction("Action","Set.ATN")

Please let me know if there's an easier way that I'm not seeing

Thanks for your time!

This topic is closed to new replies. Start a new post to keep the conversation going.
r-binCorrect answer
Legend
Mar 9, 2020 6:34 PM UTC
Unclear explain. Do you need to run a certain Action 250 times?

Create such a script and run it.
for (var i = 0; i < 250; i++) app.doAction("Action 2","Set 2");

Type the name of the Action and Set Name very carefully.
Just like in the action panel, without any ".ATN", taking into account spaces and case.
 

11 replies

Kukurykus
Legend
Nov 17, 2021 1:37 PM UTC

Moderator please assaign 'Actions and scripting' label to this thread.

Translate
PECourtejoie
Community Expert
Community Expert
Nov 17, 2021 2:29 PM UTC
это сделано
Translate
Kukurykus
Legend
Nov 17, 2021 2:51 PM UTC

Polish would be more appropriate 😛

Translate
kirank51547421
Participant
Nov 17, 2021 6:20 AM UTC

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

 

Translate
r-binCorrect answer
Legend
Mar 9, 2020 6:34 PM UTC
Unclear explain. Do you need to run a certain Action 250 times?

Create such a script and run it.
for (var i = 0; i < 250; i++) app.doAction("Action 2","Set 2");

Type the name of the Action and Set Name very carefully.
Just like in the action panel, without any ".ATN", taking into account spaces and case.
 
Translate
Participant
Mar 9, 2020 6:42 PM UTC

Thank you!

This solves my problem! 

Translate
Known Participant
Nov 13, 2020 10:46 AM UTC

Were you able to create a script to do this?  If so, can you please share it as I have no experience in how to create them.  I used to use this Iterate Actions extension to run loops: https://vimeo.com/8588910 but it no longer works in newer versions of PS.

 

Thanks

Translate