I can't use Invert the selection

The old ExtendScript can be used to reverse the selection
app.activeDocument.selection.invert();

But UXP cannot be used to reverse the selection, no response

async()=>{
const app=require(‘photoshop’).app
await app.activeDocument.selection.invert();
}

You can use this

require("photoshop").action.batchPlay(
    [{
        "_obj": "inverse"
   }], {});
1 Like