Skip to main content
Participant
September 20, 2011
Answered

Script to run an action?

  • September 20, 2011
  • 1 reply
  • 633 views

Hi, I'm not too familiar with JavaScript but I just need to be able to run an action X amount of times.  Batch dose it only with external files when I need to have action go through numerous layers in one file.

In script event manager I tried making a new event that runs my action.  Then just run a script to run that event so many times but so far no luck.  This is what I had for my script:

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

  happening

}


but it just said 'happening is undefined' when I tried to run it.

Any help appreciated!

This topic has been closed for replies.
Correct answer Muppet Mark

Im not too sure what you are asking for here? This would run an action 50 times… See comment about your strings to change…

#target Photoshop

if ( app.documents.length > 0 ) {

 

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

 

                    doAction( 'testing','test set' ); // Case Sensitive Action Name, Set Name

 

          };

 

};

But you mention layers… do you need to apply to all… If this is the case you would need to supply more detail about types and where they can be found etc.

1 reply

Muppet MarkCorrect answer
Inspiring
September 20, 2011

Im not too sure what you are asking for here? This would run an action 50 times… See comment about your strings to change…

#target Photoshop

if ( app.documents.length > 0 ) {

 

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

 

                    doAction( 'testing','test set' ); // Case Sensitive Action Name, Set Name

 

          };

 

};

But you mention layers… do you need to apply to all… If this is the case you would need to supply more detail about types and where they can be found etc.

Participant
September 20, 2011

That works great thanks!  I have the action itself go through layers, I just needed to run it X times.