Copy link to clipboard
Copied
Bonjour,
Que veut dire la commande (dans un script) : selection calque 1 sur calque 2 (sans rendre visible) ?
Merci
Copy link to clipboard
Copied
Please elaborate, maybe posting some screenshots could help.
Copy link to clipboard
Copied
This should select the next layer when it is not visible.
nextLayer(0); // up
//nextLayer(1); // down
function nextLayer(direction){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '),charIDToTypeID('Ordn'),charIDToTypeID('Trgt') );
try{
activeDocument.backgroundLayer;
index = executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1;
}catch(e){
index = executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ));
}
ref = new ActionReference();
if(direction == 0){
ref.putIndex(charIDToTypeID("Lyr "), index + 1);
}else{
ref.putIndex(charIDToTypeID("Lyr "), index -1);
}
var desc = new ActionDescriptor();
desc.putReference(charIDToTypeID("null"), ref );
desc.putBoolean( charIDToTypeID( "MkVs" ), false );
try{
executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );
}catch(e){}
};