He was born at Carnwath, Lanarkshire. He studied first divinity and then medicine at the University of Edinburgh, and subsequently, after some experience as a surgeon, took his M.D. at the University of St Andrews in 1778. He began to practise as a physician at Alnwick in Northumberland, but he became financially independent by his marriage with the daughter of John Gray, and abandoned his profession for a literary life in Edinburgh.
For several years his attention was occupied with his edition of The Works of the British Poets, with Prefaces Biographical and Critical (14 vols. 8vo, Edin., 1792-1807). His other publications were: