Skip to main content
bagonterman
Inspiring
March 19, 2013
Question

Continue loop when Photoshop ==BUSY

  • March 19, 2013
  • 1 reply
  • 2487 views

#target bridge

app.document.deselectAll();

var thumbs = app.document.getSelection("*");

for(var a in thumbs){

var f =thumbs.name.slice(0,10);

var poo=f.indexOf ("BW");

if(f.indexOf ("BW")!=-1){

    var poop=app.document.select(app.document.thumbnail.children) ;

    var isBW=app.document.selections[0].core.quickMetadata.colorMode;

    if(isBW!=1){

         poop=BridgeTalk.getStatus ( "photoshop-60.032");

         bDubAction:

         while(poop=="IDLE"){

        var thumb = app.document.selections[0];

         thumb.open();

           runAction();

           break bDubAction;

           }

        }

    }

}

function runAction(){

    var bt = new BridgeTalk;

    bt.target = "photoshop-60.032";

var crud="try{doAction('2012 eDesign BW','eDesign' );}catch(e){}";

bt.body =crud;

bt.send();}

If photoshop is IDLE this works fine. But if its busy it just skips ahead. I need it to say hey if its busy lets wait here until its Idle before I move on to the next thing. I can not seem to get my head around this.

This topic has been closed for replies.

1 reply

bagonterman
Inspiring
March 19, 2013

myOpen=thumb.open();

         if(myOpen==true){

           runAction();

           }

           }

I added this to try and quell the problem it did not work. It trys to run the action on every doc that has been opened in photoshop. Then gives an error that there is no open doc to run the action on. I am testing this by running a batch and then trying to run this at the same time.

bagonterman
Inspiring
March 19, 2013

changed to

else{chngBW(a);

closer it is still trying to run actions "a" number of times.