I want to be able to select all pixels on a layer in PhotoShop CC 2015.5. I use to be able to use…
tell application "Adobe Photoshop CC 2015.5"
tell current document
set current layer to layer "ThisLayer"
select all
translate layer "ThisLayer" delta x 0 delta y 0
end tell
end tell
This use to select all pixels with a marquee around everything.
I’m looking for an applescript command that would do the same as if I Command clicked on a layer thumbnail.
You could toggle the visibility of unwanted layers and then load the selection from either a channel composite or multiple channels or you could record an Action and use a script as a trigger; it may be easiest to use the latter method, especially if any antialiasing is present.
No problems here, please try again with this Script:
set layerName to "ThisLayer"
tell application id "com.adobe.Photoshop"
tell current document
do javascript "var idsetd = charIDToTypeID( \"setd\" );
var desc3 = new ActionDescriptor();
var idnull = charIDToTypeID( \"null\" );
var ref2 = new ActionReference();
var idChnl = charIDToTypeID( \"Chnl\" );
var idfsel = charIDToTypeID( \"fsel\" );
ref2.putProperty( idChnl, idfsel );
desc3.putReference( idnull, ref2 );
var idT = charIDToTypeID( \"T \" );
var ref3 = new ActionReference();
var idChnl = charIDToTypeID( \"Chnl\" );
var idChnl = charIDToTypeID( \"Chnl\" );
var idTrsp = charIDToTypeID( \"Trsp\" );
ref3.putEnumerated( idChnl, idChnl, idTrsp );
var idLyr = charIDToTypeID( \"Lyr \" );
ref3.putName( idLyr, \"" & layerName & "\" );
desc3.putReference( idT, ref3 );
executeAction( idsetd, desc3, DialogModes.NO );"
end tell
end tell
If you install Adobe’s ‘ScriptingListener.plugin’ here,
/Applications/Adobe Photoshop CC 2015.5/Plug-ins/Utilities/ScriptingListener.plugin
Photoshop stores every action as JavaScript in a Textfile on your desktop ‘ScriptingListenerJS.log’.
It’s very useful because not every Photoshop action is available from AppleScript.