For deleting the Layer Mask I recommend recording Action Manager code with ScriptingListener.plugin
Resizing it should be possible in DOM by selecting it (as the sole content of an Array for activeDocument.activeChannels).
For deleting the Layer Mask I recommend recording Action Manager code with ScriptingListener.plugin
Resizing it should be possible in DOM by selecting it (as the sole content of an Array for activeDocument.activeChannels).