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

1 Vote
LEGEND ,
Mar 30, 2016 Mar 30, 2016

Copy link to clipboard

Copied

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.


Image is not available

Bug Fixed
TOPICS
macOS , Windows

Views

97

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

correct answers 1 Correct answer

Adobe Employee , Jan 22, 2018 Jan 22, 2018
This issue should be fixed by the Photoshop CC 2018 (19.1) update that was released today.

Votes

Translate

Translate
3 Comments
Adobe Employee ,
Mar 31, 2016 Mar 31, 2016

Copy link to clipboard

Copied

The bad news is Photoshop CC 2015 seems to be recording the wrong thing. You can see this by using the actions panel and the recorded "with none" does NOT play back correctly. It is saying "Apply locking current layer" what?

The good news is I tried Photoshop CS6 and it says "set" as the command. The CS6 code below does play back correctly in CS6 and CC 2015.

I'll file a bug.

// =======================================================var idsetd = charIDToTypeID( "setd" );
    var desc50 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref28 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref28.putEnumerated( idLyr, idOrdn, idTrgt );
    desc50.putReference( idnull, ref28 );
    var idT = charIDToTypeID( "T   " );
        var desc51 = new ActionDescriptor();
        var idlayerLocking = stringIDToTypeID( "layerLocking" );
            var desc52 = new ActionDescriptor();
            var idprotectNone = stringIDToTypeID( "protectNone" );
            desc52.putBoolean( idprotectNone, true );
        var idlayerLocking = stringIDToTypeID( "layerLocking" );
        desc51.putObject( idlayerLocking, idlayerLocking, desc52 );
    var idLyr = charIDToTypeID( "Lyr " );
    desc50.putObject( idT, idLyr, desc51 );
executeAction( idsetd, desc50, DialogModes.NO );

Votes

Translate

Translate

Report

Report
LEGEND ,
Mar 31, 2016 Mar 31, 2016

Copy link to clipboard

Copied

Script works perfect! So I probably now have the fastest and best script for unlock everthing in layers panel 🙂 Some other script is working 30 sec to unlock 960 layers. My script can do it in less than 1 sec.

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jan 22, 2018 Jan 22, 2018

Copy link to clipboard

Copied

LATEST
This issue should be fixed by the Photoshop CC 2018 (19.1) update that was released today.

Senior Product Manager - Customer Advocacy - Digital Imaging

Votes

Translate

Translate

Report

Report