Created
January 3, 2020 15:21
-
-
Save MarshySwamp/0b1d078fba846dc9df8203caf2c36398 to your computer and use it in GitHub Desktop.
Code Snippet: Deselect All Layers (2 Different Methods)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Deselect All Layers | |
// forums.adobe.com/message/5204655#5204655 - Michael L Hale | |
app.runMenuItem(stringIDToTypeID('selectNoLayers')); | |
// Or... | |
// Deselect All Layers (AM Code Through Clean SL) | |
selectNoLayers(); | |
function selectNoLayers() { | |
var c2t = function (s) { | |
return app.charIDToTypeID(s); | |
}; | |
var s2t = function (s) { | |
return app.stringIDToTypeID(s); | |
}; | |
var descriptor = new ActionDescriptor(); | |
var reference = new ActionReference(); | |
reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" )); | |
descriptor.putReference( c2t( "null" ), reference ); | |
executeAction( s2t( "selectNoLayers" ), descriptor, DialogModes.NO ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment