Look in the Example Scripts forum where it is used. Then go and download the latest versions of the UDF scripts.

You could write your own, but these UDFs make it much simpler.