How to export PNG quickly with uxp script

QQ截图20221101180251
How to export PNG quickly with uxp script
Use app.activeDocument.saveAs png ?
Use require (“photoshop”). core batchPlay ?
thank you

If you’re asking about Ps, then wrong forum category

Thank you I have used app.action.batchPlay { _obj: “exportSelectionAsFileTypePressed”}
Solved the problem