Photoshop Script to run action X Times

December 13, 2025

To create this artwork of the ink bleeding I worked on an action that I needed to create that look, I needed to run the action multiple times to have the correct look to it. That number would be hard to know for sure but would be a lot, ended up being 32. Till running it several times I won’t know what that number would be and didn’t want to keep clicking the play button repeatedly. Another option would be to copy and paste the items in the action over and over again, then not have to run as many times; however, if I had to make another tweek I would have to do that several times and could miss some.

Worked on a script that when you open it would ask you ‘how many times’ you want it to run. In the script itself you tell it which set the action is located and the name of the action, then when you run the script a popup will ask you how many times you would like for it to run.

The script:

 #target photoshop
var XTimes = prompt("Enter number of times to run:", "10"); 
if (XTimes != null && !isNaN(XTimes)) {
    XTimes = parseInt(XTimes);
    app.activeDocument.suspendHistory("Repeat action N times", "main()");
}
function main() {
    for (var i = 0; i < XTimes; i++) {
        app.doAction("ActionName", "ActionSet");
    }
}
#END

The ‘10’ is a default number to have display in the pop-up. You can change in the pop-up box.

ActionName = Replace this with the name of the action

ActionSet = Replace with the set that the act is located in.

For both ActionName & ActionSet I’ve found it works best if there is no spaces.

Pin It on Pinterest

Share This