David Erskine (1672–1758), 13th of Dun, in the Robes of the Court of Session