vlength(vtorigin(".","../FOCUS_MAN"))
paste this into the Focus Distance parameter, replacing FOCUS_MAN with whichever object/null you're following.