"Export As" / "Save for Web" and "Select and Mask" - how to use with UXP or batch play


I’m trying to find the solution for two issues:

  1. How to create the function that will use Export As or Save for web with custom settings selected through Panel? I can’t find the way to record Export As through Alchemist and did’t find solution with UXP.

This is how I want to use it:

Zrzut ekranu 2021-12-9 o 21.10.23

  1. Hów to open Select and Mask window with batch play or UXP?

I want to open it through button in my panel:
Zrzut ekranu 2021-12-9 o 21.10.33

Thank you!

I’ve found the solution to open Select and Mask Window:

async function selectandmask() {
   await core.executeAsModal(() => {
               _obj: "smartBrushWorkspace",
               presetKind: {
                  _enum: "presetKindType",
                  _value: "presetKindDefault"
               _options: {
                  dialogOptions: "display"
   ], {});