# Artboards bounds in API 2.0

**URL:** <https://forums.creativeclouddeveloper.com/t/artboards-bounds-in-api-2-0/5023>\
**Category:** UXP Plugin API\
**Created:** [July 28, 2022, 7:57am UTC](https://forums.creativeclouddeveloper.com/t/artboards-bounds-in-api-2-0/5023 "2022-07-28T07:57:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mateszkom](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mateszkom/32/1580_2.png) [@mateszkom](https://forums.creativeclouddeveloper.com/u/mateszkom)\
**Post date:** [July 28, 2022, 7:57am UTC](https://forums.creativeclouddeveloper.com/t/artboards-bounds-in-api-2-0/5023/1 "2022-07-28T07:57:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [July 28, 2022, 10:43am UTC](https://forums.creativeclouddeveloper.com/t/artboards-bounds-in-api-2-0/5023/2 "2022-07-28T10:43:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mateszkom](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mateszkom/32/1580_2.png) [@mateszkom](https://forums.creativeclouddeveloper.com/u/mateszkom)\
**Post date:** [July 28, 2022, 11:53am UTC](https://forums.creativeclouddeveloper.com/t/artboards-bounds-in-api-2-0/5023/3 "2022-07-28T11:53:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [July 28, 2022, 2:27pm UTC](https://forums.creativeclouddeveloper.com/t/artboards-bounds-in-api-2-0/5023/4 "2022-07-28T14:27:20Z")

</div>

Meanwhile try this:

```auto
   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;

```

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/6/6542cbf7fe44f686d708e7ec37f45c4614b13634.png)

---

<div class="post-metadata">

**Author:** ![mateszkom](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mateszkom/32/1580_2.png) [@mateszkom](https://forums.creativeclouddeveloper.com/u/mateszkom)\
**Post date:** [August 2, 2022, 5:23am UTC](https://forums.creativeclouddeveloper.com/t/artboards-bounds-in-api-2-0/5023/5 "2022-08-02T05:23:15Z")

</div>

Thanks. That will do for now
