I’ve used that simple method of changing a box lenth. And I’ve just added a Slider Control (in text layer, named “BOX X CORRECTION”) that corrects the length to exact value (Notice that instead of shape layer I’ve used simple layer with mask and I just change its X position and I use a link to text layer with an offset of two layers above (-2))
temp=thisComp.layer(thisLayer,-2).text.sourceText;
xps = temp.length;
xps = 100 * (xps * .125)-250+ thisComp.layer(thisLayer,-2).effect(“BOX X CORRECTION”)(“Slider”);;
if (xps<-140) (xps=-140);
yps=thisProperty[1];
[xps,yps]