Copy link to clipboard
Copied
I'm sure that @r-bin has set you right, this is what I would have done using cleaned ScriptingListener code for the new selected/active layer:
addLayerSelToSel();
function addLayerSelToSel() {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putEnumerated( s2t( "channel" ), s2t( "channel" ), s2t( "transparencyEnum" ));
descriptor.putReference( s
...
Copy link to clipboard
Copied
Please post before and after screenshots of the layers panel to clearly illustrate the layer kinds, visibility and positions.
Copy link to clipboard
Copied
In the first image, a layer selection was created using code
I want to modify the code to add another selection next to the current selection that exists when selecting another layer
Copy link to clipboard
Copied
Where you found it is the intersectActivePixels() function.
Replace cID("Intr") with cID("Add ").
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I'm sure that @r-bin has set you right, this is what I would have done using cleaned ScriptingListener code for the new selected/active layer:
addLayerSelToSel();
function addLayerSelToSel() {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putEnumerated( s2t( "channel" ), s2t( "channel" ), s2t( "transparencyEnum" ));
descriptor.putReference( s2t( "null" ), reference );
reference2.putProperty( s2t( "channel" ), s2t( "selection" ));
descriptor.putReference( s2t( "to" ), reference2 );
executeAction( s2t( "add" ), descriptor, DialogModes.NO );
}