Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bridge batch processing script for Photoshop stops after ten mins

Explorer ,
Feb 12, 2013 Feb 12, 2013

I have a javacript to help batch process collections of images in Bridge by sending them (in layers) to Photoshop CS5. It works perfectly, except it stops running after about ten minutes (around 6-10 images) so that I have to keep restarting the script. This behaviour has only started since the script was installed in the Bridge startup folder so that it could be started from the (right click) menu. The script does not seem to time out when run via ExtendToolkit.

Does anyone know why this is happening?

TOPICS
Scripting
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 12, 2013 Feb 12, 2013

It might need to check if photoshop is busy/idle before sending more commands?

if (BridgeTalk.getStatus("photoshop") == "IDLE"){

//Send data etc

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2013 Feb 15, 2013

Thanks again Paul. Can I ask you where the best place to insert that would be? The script is below - I'm sure you'll recognise it :6).

I've also been wondering if its possible to alter the script so that the files in bridge are opened in PS as Smart Objects (in layers)? There is a script 'Open as Smart Object in Layers' but I haven't been able integrate it into your fantastic script.

#target bridge

if( BridgeTalk.appName == "bridge" ) {

processDocs = new MenuElement("command", "Process selected docs", "at the end of Thumbnail");

}

processDocs.onSelect = function () {

var sels = app.document.selections;

var selectedFiles = new Array();

for(var a in sels){

    selectedFiles.push(sels.spec);

    }

      if(selectedFiles.length> 1){

           var bt = new BridgeTalk;

           bt.target = "photoshop";

           var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+selectedFiles.toSource()+");");

           bt.body = myScript;

           bt.send(5);

    }

};


function psRemote(selectedFiles){

app.bringToFront();

for(var f in selectedFiles){

var thisDoc = open(File(selectedFiles));

/*run an action if required */

/* app.doAction("atn", "atnSet"); */

/*script listener code goes here...

  You will need to remove the //===== lines or the script will fail 

*/


/* end script listener code */


      var saveFile = new File('~/desktop/'+(new Date().getTime().toString())+'.psd');

      app.activeDocument.saveAs(saveFile);

      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

      }

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2013 Feb 15, 2013

PS: I can send you the 'Open Multiple Images as Smart Object Layers' script by email. It was written by Yegor Korzh and while it is available in binary on his website, I dont have permission to post it in the javascript form.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 15, 2013 Mar 15, 2013
LATEST

I am wondering Paul with this if statement if photoshop is not IDLE say pumping or whatever. Does this mean that it would not complete its task? I was thinking I might need something to wait until it was IDLE and then complete task. So in that case would you use a while statement. Or do you think that would create an endless loop. I would like to hear your opinion. BG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines