Volume and Volume Centroid from Blocks

Is there a workaround to get this information from a collection of Blocks? Is djordje’s script from a post in April '14 the simplest way, then make a similar script for volume?

How do I assign the script to a button?: