Some sample script to use the gps get coordinates and use the result to calculate distances:
GpsGetCoords