There is script listener. You can find description here: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photos hop-cc-scripting-guide.pdf (page 73).
But it generates low level code, so it isn't very helpfull sometimes.
thanks! yes this gives some pretty messed up code. I'm hoping there's a more straight-forward way to delete a layer mask....?
As far as I know, there is no mask object in photoshop's DOM. Therefore there are no methods to delete it.
So the only way to do it is using action manager comands. And that is what script listener does.
Fortunately, there is a library, that already has all the nessesary code: http://www.ps-scripts.com/bb/viewtopic.php?t=318 And it is defenetly more readable then script listener's one.
You can just copy the functions you need to your script and use them as any other photoshop functions.