PS - Repeat a certain action many times

Hi guys,

I was wondering if anyone would know how to script this but without using popup menus. I am using this script as a part of another actions chain so in this case it will halt the process each time I run the sequence asking me for the action to be repeated and how many times. That method which I found somewhere its superb but in this case I would need it to be run the action set in the script for a set number of times. :rolleyes:

Maybe this script structure is what you need

beg of main code
repeat x times
my repeatedAction()
end repeat
end of the main code

on repeatedAction()
the code of the action to repeat
end repeatedAction

Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) mardi 16 février 2016 10:32:21

Thanks mate not that I am experienced in scripting. I would appreciate if you could elaborate that a bit more. Thanks again.

I apologize but I am unable to guess what your main script is doing and what is the task which muist be repeated serveral times.

Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) jeudi 18 février 2016 12:24:40

The original post lacks detail, but I think the OP wants this:

tell application "Adobe Photoshop CS3"'s document 1
	repeat 3 times --or whatever # of times
		do action "Molten Lead" from "Default Actions" --respective name/location of your action
	end repeat
end tell

Hey guys thanks for the replies. The idea behind is exactly what Marc suggested but I need it to be a PS script so it can added to a chain of actions. I could repeat the action 80 times inside the folder but doing that manually for every new action chain would not be ideal. :expressionless:

Thanks Marc that script worked just fine from OSX I was wondering if thats easy to be converted to Javascript?

Here’s a starter with the javascript:

[format]var loopRepetition = 3;

for(var i=0; i < loopRepetition; i++){
app.doAction (‘Molten Lead’, ‘Default Actions’);
}[/format]

HTH

Thanks a lot TecNik thats what I needed it works perfectly. Appreciated mate. :slight_smile: