Last active
January 10, 2022 03:30
-
-
Save MarshySwamp/5eb4863d08335e870a53ef04ccb33916 to your computer and use it in GitHub Desktop.
Add a "reveal all" or "hide all" layer mask
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
addMask("reveallAll"); | |
function addMask(maskVisibility) { | |
// maskVisibility = "revealAll" or "hideAll" | |
var c2t = function (s) { | |
return app.charIDToTypeID(s); | |
}; | |
var s2t = function (s) { | |
return app.stringIDToTypeID(s); | |
}; | |
var descriptor = new ActionDescriptor(); | |
var reference = new ActionReference(); | |
descriptor.putClass(s2t("new"), s2t("channel")); | |
reference.putEnumerated(s2t("channel"), s2t("channel"), s2t("mask")); | |
descriptor.putReference(s2t("at"), reference); | |
descriptor.putEnumerated(s2t("using"), c2t("UsrM"), s2t(maskVisibility)); | |
executeAction(s2t("make"), descriptor, DialogModes.NO); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment