Skip to content

Instantly share code, notes, and snippets.

@MarshySwamp
Last active September 2, 2022 12:46
Show Gist options
  • Save MarshySwamp/4ab020487f7e8770df0edac1ad0fd855 to your computer and use it in GitHub Desktop.
Save MarshySwamp/4ab020487f7e8770df0edac1ad0fd855 to your computer and use it in GitHub Desktop.
Quick Mask Mode
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