Hey Hiro,
I don’t think it is possible to access the size of individual shape inside the layer, simply because the sourceRectAtTime() function returns object from layers data source – and shape contents inside are not of layer type.
One thing to mention though – if you add sourceRectAtTime(time,true).width into text layer to inspect what width value of shape size it returns, and make turn shape object inside the layer as ‘invisible’, the size adjusts as expected (subtracting disabled shape value from the end result).
As a bit ‘hardcoded’ workaround, you could create two extra invisible/guide shape layers, which has individual shapes inside (one for tail, one for bubble). Then, find a way to connect positioning of those individual layers to group of shapes. While it might take a while for a first execution, once you make it – then re-usability is guaranteed. Definitely, not the most precious approach 🙂
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Social Media Profiles