How to use code to collapse the selected l layer group in uxp?

Collapsing a group with batchPlay can be done using:

await batchPlay(
[
   // collapse current selected group
      {
        "_obj": "collapseAllGroupsEvent",
        "_isCommand": true,
        "_options": {
          "dialogOptions": "dontDisplay"
        }
      }
],{});
1 Like