Photoshop: Javascript - can't unlock folder with script which was generated by ScriptListener

  • 1
  • Problem
  • Updated 8 months ago
  • Solved
  • (Edited)
PS - script - can't unlock folder with script which was generated by Script Listener

#target photoshop
app.bringToFront();

var idapplyLocking = stringIDToTypeID( "applyLocking" );
var desc10 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref5 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref5.putEnumerated( idLyr, idOrdn, idTrgt );
desc10.putReference( idnull, ref5 );
var idlayerLocking = stringIDToTypeID( "layerLocking" );
var desc11 = new ActionDescriptor();
var idprotectNone = stringIDToTypeID( "protectNone" );
desc11.putBoolean( idprotectNone, true );
var idlayerLocking = stringIDToTypeID( "layerLocking" );
desc10.putObject( idlayerLocking, idlayerLocking, desc11 );
executeAction( idapplyLocking, desc10, DialogModes.NO );
I am trying unlock this folder with script above but it doesn't work. If click on lock icon(locks toolbar and lock icon next to layer name), then script listener generate this code. I can see new item in history panel.

I am trying run it from Extend ScriptToolkit. It works good for every layers inside folder and layers in subfolders, but not for folders itself.

Photo of Jaroslav Bereza

Jaroslav Bereza

  • 781 Posts
  • 166 Reply Likes
  • confused

Posted 2 years ago

  • 1
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 14149 Posts
  • 1765 Reply Likes
Official Response
This issue should be fixed by the Photoshop CC 2018 (19.1) update that was released today.