download Pins & Boxes
https://aescripts.com/pins-and-boxes/

With Pins and Boxes for After Effects you can easily create boxes around texts which adapt to the new size automatically if the text is changed. In this tutorial you learn how to combine several of these boxes into more complex shapes using a merge path. In a nutshell, you can first create several boxes – and all of them are a separate shape layer. Then you can copy the contents of each of them into a single shape layer and apply a merge path, to get a single shape including all the boxes.