Distance measure script


Could I have some guidance for creating a macro, that allows me to select objects such as in the above picture and measure

and show the distance between the middle point of the first object (different shape than the rest) and the middle point of rest of the objects.

I mean, if I select all of the above objects and click the macro, it then measures and shows the distance between all the circles and the line.