Center Anchor Point Of Null Object To A Shape's Center On Another Layer
Hello!
I want scale a text box from its center for animation. However, the anchor points of the text and box layers are both left-aligned because the box is coded to self-adjust its size to the text. So the the textbox currently scales from the left.


Since there seems to be no way of creating a second anchor point for the box that is centered, I'm thinking of parenting both the text and box layers to a null object that has an anchor that is centered to the box. But if the box self-adjusts, that means its center will also change. I want the null object's anchor point to self-adjust to the center of the box layer. I tried using putting the following expression onto the null object's anchor point
a = thisComp.layer("LayerName").sourceRectAtTime();
height = a.height;
width - a.width;
top = a.top;
left = a.left;
x = left + width/2;
y = top + height/2;
[x,y];
but it won't let me reference the "Size" shape property of the box layer as the "Layer Name".
So is it possible to have the null object's anchor point always centered to the box like this?

Or is there a better solution than using a null object layer?
Precomping also wouldn't accomplish this because, again, the box's size will always change according the length of text.
Any solutions or suggestions would be appreciated!