 In the same year he was elected a Fellow of the Royal Society of Edinburgh his proposer was James Thomson Gibson-Craig.He served as Sheriff of Argyllshire from 9 July 1851, until becoming solicitor-general for Scotland under Lord Palmerston from 14 February 1855 to 17 March 1858, and from 27 June 1859 to 10 November 1862.As a lord of the court of session, with the title of Lord Barcaple, he sat on the bench from 10 November 1862 till his death.