How to proportionally scale a group of objects using a script, like in Studio?

I’ve seen several posts on how to scale models, but none work properly.
Regardless of being a model, part or even a folder of objects, I would like to know if there is a way to scale multiple objects proportionally, like in Studio, but using a script?