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

DialogModes.NO in script ignored when called from action via Bridge Batch

New Here ,
Apr 28, 2017 Apr 28, 2017

Copy link to clipboard

Copied

I have a fully working action which includes a script call. The script includes an executeAction with suppressed dialogs (DialogModes.NO).

Everything works flawlessly when run in photoshop and also when using Automate->Batch... in Photoshop.

However, when I select the images in Bridge and then invoke the action via Tools-Photoshop->Batch, The dialog keeps appearing abd interrupts the action. DialogModes.NO seems to be ignored when running it this way.

Thankful for any insight into this.

/Johan

Script:

main(); 
  function main(){ 
    if(!documents.length) return; 
    makeLayerActiveByName("Layer  0"); 
    var fileName = decodeURI(activeDocument.name);
    var fileName = fileName.substring(0,fileName.length - 4)
    activeDocument.activeLayer.name= decodeURI(fileName); 
  }

function makeLayerActiveByName(nm) { 
  function cTID(s) { return app.charIDToTypeID(s); }; 
 
    try { 
      var desc5 = new ActionDescriptor(); 
      var ref4 = new ActionReference(); 
      ref4.putName( cTID('Lyr '),  nm); 
      desc5.putReference( cTID('null'), ref4 ); 
      desc5.putBoolean( cTID('MkVs'), false ); 
      executeAction( cTID('slct'), desc5, DialogModes.NO ); 
    return true; 
 
    } catch (e) { 
      return false; 
    }  
  };

TOPICS
Actions and scripting

Views

714

Translate

Translate

Report

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
no replies

Have something to add?

Join the conversation
Adobe