 He was elected a Fellow of the Royal Society of Edinburgh in 1822, his proposer being George Forbes.He served as their Literary Councillor 1823-6 and as the Vice-President 1842-1859.In 1825 he was translated from the Canongate to Lady Yester's Church, and was appointed a chaplain in ordinary to the king in 1830.