Skip to main content
Shulipa Bernad
Inspiring
July 30, 2018
Answered

Run a script more than once

  • July 30, 2018
  • 4 replies
  • 778 views

Hello everyone! The title says it all. I need to run the same script 4 times in sequence. It would be possible?

var descriptor = new ActionDescriptor();

var reference = new ActionReference();

reference.putProperty( charIDToTypeID( "HstS" ), charIDToTypeID( "CrnH" ));

descriptor.putReference( charIDToTypeID( "null" ), reference );

executeAction( charIDToTypeID( "Dlt " ), descriptor, DialogModes.NO );

This topic has been closed for replies.
Correct answer Chuck Uebele

Basically:

for (var i=0;i<4;i++){

//code here

}

4 replies

Shulipa Bernad
Inspiring
July 31, 2018

That's what I was looking for! Many thanks to Chuck Uebele and to all the other friends who tried to help me.

Kukurykus
Legend
July 31, 2018

Save also history state before 4 next 'actions' and rerieve it after they are done or use command to step back of 4 last tasks.

JJMack
Community Expert
Community Expert
July 31, 2018

For that just use Alt+Ctrl+Z four times to step back 4 history states  or script back up four history states do it in a single step.

JJMack
Chuck Uebele
Community Expert
Community Expert
July 31, 2018

Can't you just make a loop that runs 4 times?

Shulipa Bernad
Inspiring
July 31, 2018

How would the loop work in this script Chuck Uebele??? All help is valid. Thank you

Chuck Uebele
Community Expert
Chuck UebeleCommunity ExpertCorrect answer
Community Expert
July 31, 2018

Basically:

for (var i=0;i<4;i++){

//code here

}