Skip to content

Instantly share code, notes, and snippets.

@theMikeD
Last active December 20, 2023 00:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theMikeD/45c39f812db48fd60406 to your computer and use it in GitHub Desktop.
Save theMikeD/45c39f812db48fd60406 to your computer and use it in GitHub Desktop.
Photoshopt script that does the same thing a ctrl-clicking a layer
#target photoshop
// Mini-Script that does the same thing a ctrl-clicking a layer.
// Licensed under the GPL
ctrlLayerSelect();
// does the same thing a ctrol-clicking a layer;
function ctrlLayerSelect() {
var id1 = charIDToTypeID( "setd" );
var desc1 = new ActionDescriptor();
var id2 = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var id3 = charIDToTypeID( "Chnl" );
var id4 = charIDToTypeID( "fsel" );
ref1.putProperty( id3, id4 );
desc1.putReference( id2, ref1 );
var id5 = charIDToTypeID( "T " );
var ref2 = new ActionReference();
var id6 = charIDToTypeID( "Chnl" );
var id7 = charIDToTypeID( "Chnl" );
var id8 = charIDToTypeID( "Trsp" );
ref2.putEnumerated( id6, id7, id8 );
desc1.putReference( id5, ref2 );
executeAction( id1, desc1, DialogModes.NO );
}
@NewYears1978
Copy link

How can you select a specific layer with this and not just the active layer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment