Last active
September 2, 2022 12:46
-
-
Save MarshySwamp/4ab020487f7e8770df0edac1ad0fd855 to your computer and use it in GitHub Desktop.
Quick Mask Mode
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
activeDocument.quickMaskMode = true; | |
activeDocument.quickMaskMode = false; | |
//or | |
quickMask("set"); // or "clearEvent" | |
function quickMask(qmOpt) { | |
var s2t = function (s) { | |
return app.stringIDToTypeID(s); | |
}; | |
var descriptor = new ActionDescriptor(); | |
var reference = new ActionReference(); | |
reference.putProperty( s2t( "property" ), s2t( "quickMask" )); | |
reference.putEnumerated( s2t( "document" ), s2t( "ordinal" ), s2t( "targetEnum" )); | |
descriptor.putReference(s2t("null"), reference); | |
// "set" to enter | "clearEvent" to exit | |
executeAction( s2t( qmOpt ), descriptor, DialogModes.NO ); | |
} | |
//or | |
// Toggle QuickMask mode | |
app.activeDocument.quickMaskMode ^= 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment