How To View A Mask

Been struggling with this one for a while now.

If we have an adjustment layer which has a mask, you can press the Alt Key and click on the Mask to view just the mask.

I would like to replicate this with UXP but as we cannot send keyboard commands, I am a little stuck here.

Can anyone think of a workaround


Think I may have figured this out

result = await batchPlay(
         "_obj": "select",
         "_target": [
               "_ref": "channel",
               "_enum": "channel",
               "_value": "mask"
         "makeVisible": true,
         "_isCommand": true,
         "_options": {
            "dialogOptions": "dontDisplay"
      "synchronousExecution": false,
      "modalBehavior": "fail"