Paragraph text boundingBox

Hi,

I am trying to get size of paragraph text box, bounds are giving me only size of the content.
Its definitely possible because size is in a Properties tab but i can’t figure it out

Any ideas? Thanks in advance

okay. i get it by doing this

const getBoundingBox = async() => {
  result = await batchPlay(
  [
     {
        "_obj": "get",
        "_target": [
           {
              "_property": "boundingBox"
           },
           {
              "_ref": "layer",
              "_enum": "ordinal",
              "_value": "targetEnum"
           },
        ],
        "_options": {
           "dialogOptions": "dontDisplay"
        }
     }
  ],{
     "synchronousExecution": false,
     "modalBehavior": "fail"
  });
  return [result[0].boundingBox.width._value, result[0].boundingBox.height._value]
}

probably not the best way but it works

1 Like

BatchPlay most of the time IS the best way :slight_smile:

1 Like

Just a side note, that not everything you see on the UI is also scriptable :wink: There are certain things that only get calculated/displayed on UI level and can’t be accessed via scripts.

2 Likes