Help me please. I want to convert this code
Code: Select allif(app.activeDocument.activeLayer.parent.typename == "LayerSet")
app.activeDocument.activeLayer.parent.opacity=75;
a strange language "ActionDescriptor-ActionReference"
I need to change the opacity "LayerSet".
I'm doing this:
Code: Select all var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(cTID('Opct'), cTID('#Prc'), 75 );
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
but it changes the opacity of the layer itself, and not the parent!
thanks in advance
Change opacity parent of layer
-
Mike Hale
Change opacity parent of layer
I am not sure what you are asking but if you want to convert the ActionManager code to a Photoshop Object Model version it would look like this.
Code: Select allapp.activeDocument.activeLayer.opacity=75;
Note that will set the opacity of the activeLayer. The ActionManager code doesn't check to see if the activeLayer is a layerSet as your first code does. But you can add the if statement if wanted. just remove the '.parent' part.
Code: Select allapp.activeDocument.activeLayer.opacity=75;
Note that will set the opacity of the activeLayer. The ActionManager code doesn't check to see if the activeLayer is a layerSet as your first code does. But you can add the if statement if wanted. just remove the '.parent' part.