Are all the sprites one object or separate? If it is one object you can use a loop and a counter.
First set CounterVariable to 0.
Repeat Sprite.Count times - Add Sprite(loopindex).Width to CounterVariable.
Make sure the loop runs by trigger and not every tick.
If they are separate objects you should be able to do the same thing with family.