Function for Layer Mask > Reveal Selection?
I'm making a script in which in the middle of it I need to apply a mask on the current selection, I'm not sure if I'm not knowing how to search for it but I just couldn't find an answer, so I thought I should ask it here. Is it possible to create a function that pretty much does the same as if I had an active selection and I applied a mask to it, using the button on the picture. Or to be more precise the Photoshop Keyboard Shortcuts on the Layer Mask Section calls it "Reveal Selection". So basically this:



So basically as in the images a function that would mask the selected area.
