Artboards bounds in API 2.0

Hi there. I am trying to get bounds of each artboard of active document
In api 1 results of e.g. (app.activeDocument.artboards[0].bounds) were correct.
In api 2 I get bounds of whole canvas instead of single artboard bounds

Is there any other way to get artboards bounds?

1 Like

I will look into it. I think this has to work.

1 Like

Thanks.
I checked vanilla & react and got the same wrong results

EDIT:/// I just found out that bounds aren’t artboard size now but a content inside artboard size.

This don’t fix my problem tho, still can’t find any trace of artboard size

Meanwhile try this:

   const {batchPlay} = require("photoshop").action;

   const result = await batchPlay(
      [
         {
            _obj: "get",
            _target: [
               {
                  _property: "artboard"
               },
               {
                  _ref: "layer",
                  _id: 9 //change this ID
               },
               {
                  _ref: "document",
                  _id: 219 //change this ID
               }
            ],
            _options: {
               dialogOptions: "dontDisplay"
            }
         }
      ],
      {
      }
   );
   
   const pinned = result[0].artboard.artboardRect;

1 Like

Thanks. That will do for now