target = thisComp.layer("Target Layer");// pick your target layerp1 = position;p2 = target.position;length(p1, p2);