Set Layer Group Fill Opacity from AM

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

bdeshazer

Set Layer Group Fill Opacity from AM

Post by bdeshazer »

Ok, I've got a few questions I need help with from the community, thought I'd start with a "softball" one

The following is recorded via scriptlistener when changing the 'Fill' opacity of a layer group from the layer palette GUI:

Code: Select allvar idsetd = charIDToTypeID( "setd" );
    var desc3 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref2 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref2.putEnumerated( idLyr, idOrdn, idTrgt );
    desc3.putReference( idnull, ref2 );
    var idT = charIDToTypeID( "T   " );
        var desc4 = new ActionDescriptor();
        var idfillOpacity = stringIDToTypeID( "fillOpacity" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idfillOpacity, idPrc, 50.000000 );
    var idLyr = charIDToTypeID( "Lyr " );
    desc3.putObject( idT, idLyr, desc4 );
executeAction( idsetd, desc3, DialogModes.NO );


However, playing this back throws an exception that "- The command “Set” is not currently available."

Changing the "regular" opacity of a layer group works fine using the recorded scriptlistener code for that which is:

Code: Select allvar idsetd = charIDToTypeID( "setd" );
    var desc10 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref8 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref8.putEnumerated( idLyr, idOrdn, idTrgt );
    desc10.putReference( idnull, ref8 );
    var idT = charIDToTypeID( "T   " );
        var desc11 = new ActionDescriptor();
        var idOpct = charIDToTypeID( "Opct" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc11.putUnitDouble( idOpct, idPrc, 50.000000 );
    var idLyr = charIDToTypeID( "Lyr " );
    desc10.putObject( idT, idLyr, desc11 );
executeAction( idsetd, desc10, DialogModes.NO );

The only difference I can see between the two is that the "fillOpacity" command uses a stringID while the "Opct" command uses a charID... I checked but there doesn't appear to be an equivalent charID for "fillOpacity" to test if that was (however unlikely) somehow responsible.

Any thoughts/ideas/help appreciated!

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

bdeshazer

Set Layer Group Fill Opacity from AM

Post by bdeshazer »

On further investigation I believe this is just a bug in CS6 as recording the changing of a groups fill opacity in an action produces the same error on playback.

Tested this on the original Mac OS release of CS6 (13.0?) and also on the latest 13.0.4... anyone confirm this is also an issue on Windows?